Compare commits

..

10 Commits

Author SHA1 Message Date
GreemDev
e8751e1c40 more C# 14 partial properties 2025-11-16 19:14:26 -06:00
GreemDev
09748b140a Use the new C# 14 null propagation setter 2025-11-16 19:14:26 -06:00
Coxxs
456db46065 Stub IWriterForApplication: 0 (CreateContextRegistrar) (ryubing/ryujinx!183)
See merge request ryubing/ryujinx!183
2025-11-16 18:24:41 -06:00
GreemDev
7b39ff36c0 docs: compat: ZA LDN works and has for a while 2025-11-16 00:30:37 -06:00
Maki
10476771d3 fix: detect face button layout for gamepads (ryubing/ryujinx!219)
See merge request ryubing/ryujinx!219
2025-11-14 12:51:53 -06:00
Maki
c5082ac85a fix: make controller GUIDs match old SDL2 GUIDs (ryubing/ryujinx!218)
See merge request ryubing/ryujinx!218
2025-11-14 11:52:42 -06:00
GreemDev
5e86ad83cc feature: macOS Liquid Glass dynamic icon
No more squircle jail! Thanks @transistor.exe in the Ryubing discord for dropping the asset files for this to happen.
2025-11-13 20:47:05 -06:00
Coxxs
1baaa1c365 Preserve and rename the configuration file when it is deemed invalid (ryubing/ryujinx!216)
See merge request ryubing/ryujinx!216
2025-11-12 08:23:05 -06:00
LotP
e8225ce7aa Memory changes 3.1 (ryubing/ryujinx!212)
See merge request ryubing/ryujinx!212
2025-11-11 13:24:57 -06:00
GreemDev
6b814fb973 feature: .NET 10 (ryubing/ryujinx!214)
See merge request ryubing/ryujinx!214
2025-11-11 12:55:36 -06:00
36 changed files with 373 additions and 230 deletions

2
.gitignore vendored
View File

@@ -18,6 +18,8 @@ build/
[Oo]bj/
AppDir/
publish_appimage/
publish_ava/
publish_tmp_ava/
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
!packages/*/build/

Binary file not shown.

View File

@@ -10,6 +10,8 @@
<string>Ryujinx</string>
<key>CFBundleIconFile</key>
<string>Ryujinx.icns</string>
<key>CFBundleIconName</key>
<string>Ryujinx</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
@@ -40,7 +42,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.2</string>
<string>1.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>

View File

@@ -25,6 +25,7 @@ cp "$PUBLISH_DIRECTORY"/*.dylib "$APP_BUNDLE_DIRECTORY/Contents/Frameworks"
cp Info.plist "$APP_BUNDLE_DIRECTORY/Contents"
cp Ryujinx.icns "$APP_BUNDLE_DIRECTORY/Contents/Resources/Ryujinx.icns"
cp updater.sh "$APP_BUNDLE_DIRECTORY/Contents/Resources/updater.sh"
cp Assets.car "$APP_BUNDLE_DIRECTORY/Contents/Resources/Assets.car"
cp -r "$PUBLISH_DIRECTORY/THIRDPARTY.md" "$APP_BUNDLE_DIRECTORY/Contents/Resources"
echo -n "APPL????" > "$APP_BUNDLE_DIRECTORY/Contents/PkgInfo"

View File

@@ -2275,12 +2275,12 @@
010018E011D92000,"Pokémon™ Shining Pearl",gpu;ldn-works,ingame,2024-08-28 13:26:35
010015F008C54000,"Pokémon™ HOME",Needs Update;crash;services,menus,2020-12-06 06:01:51
01001F5010DFA000,"Pokémon™ Legends: Arceus",gpu;Needs Update;ldn-works,ingame,2024-09-19 10:02:02
0100F43008C44000,"Pokémon™ Legends: Z-A",gpu;crash;ldn-works,ingame,2025-11-16 00:30:00
01005D100807A000,"Pokémon™ Quest",,playable,2022-02-22 16:12:32
0100A3D008C5C000,"Pokémon™ Scarlet",gpu;nvdec;ldn-works;amd-vendor-bug,ingame,2023-12-14 13:18:29
01008F6008C5E000,"Pokémon™ Violet",gpu;nvdec;ldn-works;amd-vendor-bug;mac-bug,ingame,2024-07-30 02:51:48
0100187003A36000,"Pokémon™: Lets Go, Eevee!",crash;nvdec;online-broken;ldn-broken,ingame,2024-06-01 15:03:04
010003F003A34000,"Pokémon™: Lets Go, Pikachu!",crash;nvdec;online-broken;ldn-broken,ingame,2024-03-15 07:55:41
0100F43008C44000,"Pokémon Legends: Z-A",gpu;crash;ldn-broken,ingame,2025-10-16 19:13:00
0100B3F000BE2000,"Pokkén Tournament™ DX",nvdec;ldn-works;opengl-backend-bug;LAN;amd-vendor-bug;intel-vendor-bug,playable,2024-07-18 23:11:08
010030D005AE6000,"Pokkén Tournament™ DX Demo",demo;opengl-backend-bug,playable,2022-08-10 12:03:19
0100A3500B4EC000,"Polandball: Can Into Space",,playable,2020-06-25 15:13:26
1 title_id game_name labels status last_updated
2275 010018E011D92000 Pokémon™ Shining Pearl gpu;ldn-works ingame 2024-08-28 13:26:35
2276 010015F008C54000 Pokémon™ HOME Needs Update;crash;services menus 2020-12-06 06:01:51
2277 01001F5010DFA000 Pokémon™ Legends: Arceus gpu;Needs Update;ldn-works ingame 2024-09-19 10:02:02
2278 0100F43008C44000 Pokémon™ Legends: Z-A gpu;crash;ldn-works ingame 2025-11-16 00:30:00
2279 01005D100807A000 Pokémon™ Quest playable 2022-02-22 16:12:32
2280 0100A3D008C5C000 Pokémon™ Scarlet gpu;nvdec;ldn-works;amd-vendor-bug ingame 2023-12-14 13:18:29
2281 01008F6008C5E000 Pokémon™ Violet gpu;nvdec;ldn-works;amd-vendor-bug;mac-bug ingame 2024-07-30 02:51:48
2282 0100187003A36000 Pokémon™: Let’s Go, Eevee! crash;nvdec;online-broken;ldn-broken ingame 2024-06-01 15:03:04
2283 010003F003A34000 Pokémon™: Let’s Go, Pikachu! crash;nvdec;online-broken;ldn-broken ingame 2024-03-15 07:55:41
0100F43008C44000 Pokémon Legends: Z-A gpu;crash;ldn-broken ingame 2025-10-16 19:13:00
2284 0100B3F000BE2000 Pokkén Tournament™ DX nvdec;ldn-works;opengl-backend-bug;LAN;amd-vendor-bug;intel-vendor-bug playable 2024-07-18 23:11:08
2285 010030D005AE6000 Pokkén Tournament™ DX Demo demo;opengl-backend-bug playable 2022-08-10 12:03:19
2286 0100A3500B4EC000 Polandball: Can Into Space playable 2020-06-25 15:13:26

View File

@@ -361,10 +361,7 @@ namespace ARMeilleure.Translation
IntervalTreeNode<TK, TV> tmp = LeftOf(replacementNode) ?? RightOf(replacementNode);
if (tmp != null)
{
tmp.Parent = ParentOf(replacementNode);
}
tmp?.Parent = ParentOf(replacementNode);
if (ParentOf(replacementNode) == null)
{
@@ -582,10 +579,7 @@ namespace ARMeilleure.Translation
{
IntervalTreeNode<TK, TV> right = RightOf(node);
node.Right = LeftOf(right);
if (node.Right != null)
{
node.Right.Parent = node;
}
node.Right?.Parent = node;
IntervalTreeNode<TK, TV> nodeParent = ParentOf(node);
right.Parent = nodeParent;
@@ -615,10 +609,7 @@ namespace ARMeilleure.Translation
{
IntervalTreeNode<TK, TV> left = LeftOf(node);
node.Left = RightOf(left);
if (node.Left != null)
{
node.Left.Parent = node;
}
node.Left?.Parent = node;
IntervalTreeNode<TK, TV> nodeParent = ParentOf(node);
left.Parent = nodeParent;
@@ -667,10 +658,7 @@ namespace ARMeilleure.Translation
/// <param name="color">Color (Boolean)</param>
private static void SetColor(IntervalTreeNode<TK, TV> node, bool color)
{
if (node != null)
{
node.Color = color;
}
node?.Color = color;
}
/// <summary>

View File

@@ -92,6 +92,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
}
short[] outputBuffer = ArrayPool<short>.Shared.Rent((int)inputCount * SampleCount);
Array.Fill(outputBuffer, (short)0, 0, (int)inputCount * SampleCount);
for (int i = 0; i < bufferCount; i++)
{

View File

@@ -386,10 +386,7 @@ namespace Ryujinx.Common.Collections
IntervalTreeNode<TKey, TValue> tmp = LeftOf(replacementNode) ?? RightOf(replacementNode);
if (tmp != null)
{
tmp.Parent = ParentOf(replacementNode);
}
tmp?.Parent = ParentOf(replacementNode);
if (ParentOf(replacementNode) == null)
{

View File

@@ -235,10 +235,7 @@ namespace Ryujinx.Common.Collections
parent = ParentOf(element);
color = ColorOf(element);
if (child != null)
{
child.Parent = parent;
}
child?.Parent = parent;
if (parent == null)
{
@@ -258,8 +255,7 @@ namespace Ryujinx.Common.Collections
element.Right = old.Right;
element.Parent = old.Parent;
element.Predecessor = old.Predecessor;
if (element.Predecessor != null)
element.Predecessor.Successor = element;
element.Predecessor?.Successor = element;
if (ParentOf(old) == null)
{
@@ -292,10 +288,7 @@ namespace Ryujinx.Common.Collections
parent = ParentOf(nodeToDelete);
color = ColorOf(nodeToDelete);
if (child != null)
{
child.Parent = parent;
}
child?.Parent = parent;
if (parent == null)
{
@@ -314,11 +307,9 @@ namespace Ryujinx.Common.Collections
{
RestoreBalanceAfterRemoval(child);
}
if (old.Successor != null)
old.Successor.Predecessor = old.Predecessor;
if (old.Predecessor != null)
old.Predecessor.Successor = old.Successor;
old.Successor?.Predecessor = old.Predecessor;
old.Predecessor?.Successor = old.Successor;
return old;
}

View File

@@ -250,10 +250,7 @@ namespace Ryujinx.Common.Collections
{
T right = RightOf(node);
node.Right = LeftOf(right);
if (node.Right != null)
{
node.Right.Parent = node;
}
node.Right?.Parent = node;
T nodeParent = ParentOf(node);
right.Parent = nodeParent;
@@ -281,10 +278,7 @@ namespace Ryujinx.Common.Collections
{
T left = LeftOf(node);
node.Left = RightOf(left);
if (node.Left != null)
{
node.Left.Parent = node;
}
node.Left?.Parent = node;
T nodeParent = ParentOf(node);
left.Parent = nodeParent;
@@ -329,10 +323,7 @@ namespace Ryujinx.Common.Collections
/// <param name="color">Color (Boolean)</param>
protected static void SetColor(T node, bool color)
{
if (node != null)
{
node.Color = color;
}
node?.Color = color;
}
/// <summary>

View File

@@ -328,10 +328,7 @@ namespace Ryujinx.Common.Collections
Node<TKey, TValue> tmp = LeftOf(replacementNode) ?? RightOf(replacementNode);
if (tmp != null)
{
tmp.Parent = ParentOf(replacementNode);
}
tmp?.Parent = ParentOf(replacementNode);
if (ParentOf(replacementNode) == null)
{

View File

@@ -35,6 +35,7 @@ namespace Ryujinx.Common.Logging
ServiceBsd,
ServiceBtm,
ServiceCaps,
ServiceEctx,
ServiceFatal,
ServiceFriend,
ServiceFs,

View File

@@ -84,10 +84,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
for (int i = 0; i < count; i++)
{
ICounterEvent evt = _items[index + i].Event;
if (evt != null)
{
evt.Invalid = true;
}
evt?.Invalid = true;
}
_items.RemoveRange(index, count);

View File

@@ -26,12 +26,8 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
// - Both branches are jumping to the same location.
// In this case, the branch on the current block can be removed,
// as the next block is going to jump to the same place anyway.
if (nextBlock == null)
{
return false;
}
if (nextBlock.Operations.First?.Value is not Operation next)
if (nextBlock?.Operations.First?.Value is not Operation next)
{
return false;
}

View File

@@ -891,10 +891,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler
result = new NestedName(name, prev);
}
if (context != null)
{
context.FinishWithTemplateArguments = false;
}
context?.FinishWithTemplateArguments = false;
return result;
}
@@ -1074,10 +1071,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler
return null;
}
if (context != null)
{
context.CtorDtorConversion = true;
}
context?.CtorDtorConversion = true;
return new ConversionOperatorType(type);
default:
@@ -1349,10 +1343,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler
_position++;
if (context != null)
{
context.CtorDtorConversion = true;
}
context?.CtorDtorConversion = true;
if (isInherited && ParseName(context) == null)
{
@@ -1372,10 +1363,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler
_position++;
if (context != null)
{
context.CtorDtorConversion = true;
}
context?.CtorDtorConversion = true;
return new CtorDtorNameType(prev, true);
}
@@ -3005,16 +2993,10 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler
BaseNode result = null;
CvType cv = new(ParseCvQualifiers(), null);
if (context != null)
{
context.Cv = cv;
}
context?.Cv = cv;
SimpleReferenceType Ref = ParseRefQualifiers();
if (context != null)
{
context.Ref = Ref;
}
context?.Ref = Ref;
if (ConsumeIf("St"))
{
@@ -3060,10 +3042,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler
}
result = new NameTypeWithTemplateArguments(result, templateArgument);
if (context != null)
{
context.FinishWithTemplateArguments = true;
}
context?.FinishWithTemplateArguments = true;
_substitutionList.Add(result);
continue;
@@ -3256,10 +3235,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler
return null;
}
if (context != null)
{
context.FinishWithTemplateArguments = true;
}
context?.FinishWithTemplateArguments = true;
return new NameTypeWithTemplateArguments(substitution, templateArguments);
}
@@ -3279,10 +3255,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler
return null;
}
if (context != null)
{
context.FinishWithTemplateArguments = true;
}
context?.FinishWithTemplateArguments = true;
return new NameTypeWithTemplateArguments(result, templateArguments);
}

View File

@@ -174,10 +174,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
if (previousThread != nextThread)
{
if (previousThread != null)
{
previousThread.LastScheduledTime = PerformanceCounter.ElapsedTicks;
}
previousThread?.LastScheduledTime = PerformanceCounter.ElapsedTicks;
_state.SelectedThread = nextThread;
_state.NeedsScheduling = true;

View File

@@ -0,0 +1,32 @@
using System;
using Ryujinx.Common.Logging;
using Ryujinx.Horizon.Common;
namespace Ryujinx.HLE.HOS.Services.Ectx
{
class IContextRegistrar : DisposableIpcService
{
public IContextRegistrar(ServiceCtx context) { }
[CommandCmif(0)] // 11.0.0+
// Complete(nn::Result result, buffer<bytes, 5> raw_context) -> (i32 context_descriptor)
public ResultCode Complete(ServiceCtx context)
{
Result result = new(context.RequestData.ReadInt32());
ulong rawContextPosition = context.Request.SendBuff[0].Position;
ulong rawContextSize = context.Request.SendBuff[0].Size;
byte[] rawContext = new byte[rawContextSize];
context.Memory.Read(rawContextPosition, rawContext);
context.ResponseData.Write(0); // TODO: return context_descriptor
Logger.Stub?.PrintStub(LogClass.ServiceEctx, $"Result: {result}, rawContext: {Convert.ToHexString(rawContext)}" );
return ResultCode.Success;
}
protected override void Dispose(bool isDisposing) { }
}
}

View File

@@ -4,5 +4,14 @@ namespace Ryujinx.HLE.HOS.Services.Ectx
class IWriterForApplication : IpcService
{
public IWriterForApplication(ServiceCtx context) { }
[CommandCmif(0)]
// CreateContextRegistrar() -> object<nn::err::context::IContextRegistrar>
public ResultCode CreateContextRegistrar(ServiceCtx context)
{
MakeObject(context, new IContextRegistrar(context));
return ResultCode.Success;
}
}
}

View File

@@ -1169,9 +1169,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
public override void DestroyAtExit()
{
if (_context != null) {
_context.Dispose();
}
_context?.Dispose();
}
}
}

View File

@@ -22,7 +22,7 @@ namespace Ryujinx.Input.SDL3
private StandardControllerInputConfig _configuration;
private static readonly SDL_GamepadButton[] _buttonsDriverMapping =
private readonly SDL_GamepadButton[] _buttonsDriverMapping =
[
// Unbound, ignored.
SDL_GamepadButton.SDL_GAMEPAD_BUTTON_INVALID,
@@ -88,6 +88,20 @@ namespace Ryujinx.Input.SDL3
Features = GetFeaturesFlag();
_triggerThreshold = 0.0f;
// Face button mapping
SDL_GamepadButton[] faceButtons = _buttonsDriverMapping[1..5];
foreach (SDL_GamepadButton btn in faceButtons) {
int mapId = SDL_GetGamepadButtonLabel(_gamepadHandle, btn) switch {
SDL_GamepadButtonLabel.SDL_GAMEPAD_BUTTON_LABEL_A or SDL_GamepadButtonLabel.SDL_GAMEPAD_BUTTON_LABEL_CROSS => 1,
SDL_GamepadButtonLabel.SDL_GAMEPAD_BUTTON_LABEL_B or SDL_GamepadButtonLabel.SDL_GAMEPAD_BUTTON_LABEL_CIRCLE => 2,
SDL_GamepadButtonLabel.SDL_GAMEPAD_BUTTON_LABEL_X or SDL_GamepadButtonLabel.SDL_GAMEPAD_BUTTON_LABEL_SQUARE => 3,
SDL_GamepadButtonLabel.SDL_GAMEPAD_BUTTON_LABEL_Y or SDL_GamepadButtonLabel.SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE => 4,
_ => -1
};
if (mapId == -1) { continue; }
_buttonsDriverMapping[mapId] = btn;
}
// Enable motion tracking
if ((Features & GamepadFeaturesFlag.Motion) != 0)
{

View File

@@ -65,7 +65,7 @@ namespace Ryujinx.Input.SDL3
string strGuid = new(guidBytes);
return $"{strGuid[0..8]}-{strGuid[8..12]}-{strGuid[12..16]}-{strGuid[16..20]}-{strGuid[20..32]}";
return $"{strGuid[4..6]}{strGuid[6..8]}{strGuid[2..4]}{strGuid[0..2]}-{strGuid[10..12]}{strGuid[8..10]}-{strGuid[12..16]}-{strGuid[16..20]}-{strGuid[20..32]}";
}

View File

@@ -330,6 +330,7 @@ namespace Ryujinx.Input.HLE
_device.TamperMachine.UpdateInput(hleInputStates);
hleMotionStates.Clear();
_hleMotionStatesPool.Release(hleMotionStates);
}
}

View File

@@ -58,10 +58,7 @@ namespace Ryujinx.Memory.Tracking
{
foreach (RegionHandle handle in _handles)
{
if (handle != null)
{
handle?.RegisterAction((address, size) => action(handle.Address, handle.Size));
}
handle?.RegisterAction((address, size) => action(handle.Address, handle.Size));
}
}
@@ -69,10 +66,7 @@ namespace Ryujinx.Memory.Tracking
{
foreach (RegionHandle handle in _handles)
{
if (handle != null)
{
handle?.RegisterPreciseAction((address, size, write) => action(handle.Address, handle.Size, write));
}
handle?.RegisterPreciseAction((address, size, write) => action(handle.Address, handle.Size, write));
}
}

View File

@@ -233,6 +233,8 @@ namespace Ryujinx.Ava
{
Logger.Warning?.PrintMsg(LogClass.Application, $"Failed to load config! Loading the default config instead.\nFailed config location: {ConfigurationPath}");
ConfigurationFileFormat.RenameInvalidConfigFile(ConfigurationPath);
ConfigurationState.Instance.LoadDefault();
}
}

View File

@@ -501,18 +501,12 @@ namespace Ryujinx.Ava.Systems
private void UpdateIgnoreMissingServicesState(object sender, ReactiveEventArgs<bool> args)
{
if (Device != null)
{
Device.Configuration.IgnoreMissingServices = args.NewValue;
}
Device?.Configuration.IgnoreMissingServices = args.NewValue;
}
private void UpdateAspectRatioState(object sender, ReactiveEventArgs<AspectRatio> args)
{
if (Device != null)
{
Device.Configuration.AspectRatio = args.NewValue;
}
Device?.Configuration.AspectRatio = args.NewValue;
}
private void UpdateAntiAliasing(object sender, ReactiveEventArgs<AntiAliasing> e)

View File

@@ -6,7 +6,9 @@ using Ryujinx.Common.Configuration.Multiplayer;
using Ryujinx.Common.Logging;
using Ryujinx.Common.Utilities;
using Ryujinx.HLE;
using System;
using System.Collections.Generic;
using System.IO;
namespace Ryujinx.Ava.Systems.Configuration
{
@@ -510,6 +512,43 @@ namespace Ryujinx.Ava.Systems.Configuration
}
}
/// <summary>
/// Renames the configuration file when it is deemed invalid
/// </summary>
/// <param name="path">The path to the invalid JSON configuration file</param>
/// <returns>The path of the renamed invalid JSON configuration file, or null if the rename failed</returns>
public static string RenameInvalidConfigFile(string path)
{
if (string.IsNullOrWhiteSpace(path) || !File.Exists(path))
{
return null;
}
try
{
string directory = Path.GetDirectoryName(path) ?? string.Empty;
string originalFileName = Path.GetFileName(path);
if (string.IsNullOrWhiteSpace(originalFileName))
{
return null;
}
string renamedFileName = $"{originalFileName}.{DateTime.Now:yyyy-MM-dd_HH-mm-ss}.invalid";
string renamedPath = string.IsNullOrEmpty(directory) ? renamedFileName : Path.Combine(directory, renamedFileName);
File.Move(path, renamedPath, overwrite: false);
Logger.Warning?.PrintMsg(LogClass.Application, $"Invalid configuration renamed to: {renamedPath}");
return renamedPath;
}
catch (Exception ex)
{
Logger.Error?.PrintMsg(LogClass.Application, $"Failed to rename invalid configuration file \"{path}\": {ex}");
return null;
}
}
/// <summary>
/// Save a configuration file to disk
/// </summary>

View File

@@ -28,6 +28,8 @@ namespace Ryujinx.Ava.Systems.Configuration
{
RyuLogger.Warning?.Print(LogClass.Application, $"Unsupported configuration version {cff.Version}, loading default.");
ConfigurationFileFormat.RenameInvalidConfigFile(configurationFilePath);
LoadDefault();
return;
}

View File

@@ -167,10 +167,7 @@ namespace Ryujinx.Ava.UI.Controls
private void Message_TextInput(object sender, TextInputEventArgs e)
{
if (_host != null)
{
_host.IsPrimaryButtonEnabled = _checkLength(Message.Length) && _checkInput(Message);
}
_host?.IsPrimaryButtonEnabled = _checkLength(Message.Length) && _checkInput(Message);
}
private void Message_KeyUp(object sender, KeyEventArgs e)

View File

@@ -27,82 +27,136 @@ namespace Ryujinx.Ava.UI.Models.Input
public ControllerType ControllerType { get; set; }
public PlayerIndex PlayerIndex { get; set; }
[ObservableProperty] private StickInputId _leftJoystick;
[ObservableProperty] private bool _leftInvertStickX;
[ObservableProperty] private bool _leftInvertStickY;
[ObservableProperty] private bool _leftRotate90;
[ObservableProperty] private GamepadInputId _leftStickButton;
[ObservableProperty]
public partial StickInputId LeftJoystick { get; set; }
[ObservableProperty] private StickInputId _rightJoystick;
[ObservableProperty] private bool _rightInvertStickX;
[ObservableProperty] private bool _rightInvertStickY;
[ObservableProperty] private bool _rightRotate90;
[ObservableProperty] private GamepadInputId _rightStickButton;
[ObservableProperty]
public partial bool LeftInvertStickX { get; set; }
[ObservableProperty] private GamepadInputId _dpadUp;
[ObservableProperty] private GamepadInputId _dpadDown;
[ObservableProperty] private GamepadInputId _dpadLeft;
[ObservableProperty] private GamepadInputId _dpadRight;
[ObservableProperty]
public partial bool LeftInvertStickY { get; set; }
[ObservableProperty] private GamepadInputId _buttonMinus;
[ObservableProperty] private GamepadInputId _buttonPlus;
[ObservableProperty]
public partial bool LeftRotate90 { get; set; }
[ObservableProperty] private GamepadInputId _buttonA;
[ObservableProperty] private GamepadInputId _buttonB;
[ObservableProperty] private GamepadInputId _buttonX;
[ObservableProperty] private GamepadInputId _buttonY;
[ObservableProperty]
public partial GamepadInputId LeftStickButton { get; set; }
[ObservableProperty] private GamepadInputId _buttonZl;
[ObservableProperty] private GamepadInputId _buttonZr;
[ObservableProperty]
public partial StickInputId RightJoystick { get; set; }
[ObservableProperty] private GamepadInputId _buttonL;
[ObservableProperty] private GamepadInputId _buttonR;
[ObservableProperty]
public partial bool RightInvertStickX { get; set; }
[ObservableProperty] private GamepadInputId _leftButtonSl;
[ObservableProperty] private GamepadInputId _leftButtonSr;
[ObservableProperty]
public partial bool RightInvertStickY { get; set; }
[ObservableProperty] private GamepadInputId _rightButtonSl;
[ObservableProperty] private GamepadInputId _rightButtonSr;
[ObservableProperty]
public partial bool RightRotate90 { get; set; }
[ObservableProperty] private float _deadzoneLeft;
[ObservableProperty] private float _deadzoneRight;
[ObservableProperty]
public partial GamepadInputId RightStickButton { get; set; }
[ObservableProperty] private float _rangeLeft;
[ObservableProperty] private float _rangeRight;
[ObservableProperty]
public partial GamepadInputId DpadUp { get; set; }
[ObservableProperty] private float _triggerThreshold;
[ObservableProperty]
public partial GamepadInputId DpadDown { get; set; }
[ObservableProperty] private bool _enableMotion;
[ObservableProperty]
public partial GamepadInputId DpadLeft { get; set; }
[ObservableProperty] private bool _enableRumble;
[ObservableProperty]
public partial GamepadInputId DpadRight { get; set; }
[ObservableProperty] private bool _enableLedChanging;
[ObservableProperty]
public partial GamepadInputId ButtonMinus { get; set; }
[ObservableProperty] private Color _ledColor;
[ObservableProperty]
public partial GamepadInputId ButtonPlus { get; set; }
[ObservableProperty]
public partial GamepadInputId ButtonA { get; set; }
[ObservableProperty]
public partial GamepadInputId ButtonB { get; set; }
[ObservableProperty]
public partial GamepadInputId ButtonX { get; set; }
[ObservableProperty]
public partial GamepadInputId ButtonY { get; set; }
[ObservableProperty]
public partial GamepadInputId ButtonZl { get; set; }
[ObservableProperty]
public partial GamepadInputId ButtonZr { get; set; }
[ObservableProperty]
public partial GamepadInputId ButtonL { get; set; }
[ObservableProperty]
public partial GamepadInputId ButtonR { get; set; }
[ObservableProperty]
public partial GamepadInputId LeftButtonSl { get; set; }
[ObservableProperty]
public partial GamepadInputId LeftButtonSr { get; set; }
[ObservableProperty]
public partial GamepadInputId RightButtonSl { get; set; }
[ObservableProperty]
public partial GamepadInputId RightButtonSr { get; set; }
[ObservableProperty]
public partial float DeadzoneLeft { get; set; }
[ObservableProperty]
public partial float DeadzoneRight { get; set; }
[ObservableProperty]
public partial float RangeLeft { get; set; }
[ObservableProperty]
public partial float RangeRight { get; set; }
[ObservableProperty]
public partial float TriggerThreshold { get; set; }
[ObservableProperty]
public partial bool EnableMotion { get; set; }
[ObservableProperty]
public partial bool EnableRumble { get; set; }
[ObservableProperty]
public partial bool EnableLedChanging { get; set; }
[ObservableProperty]
public partial Color LedColor { get; set; }
public bool ShowLedColorPicker => !TurnOffLed && !UseRainbowLed;
private bool _turnOffLed;
public bool TurnOffLed
{
get => _turnOffLed;
get;
set
{
_turnOffLed = value;
field = value;
OnPropertyChanged();
OnPropertyChanged(nameof(ShowLedColorPicker));
}
}
private bool _useRainbowLed;
public bool UseRainbowLed
{
get => _useRainbowLed;
get;
set
{
_useRainbowLed = value;
field = value;
OnPropertyChanged();
OnPropertyChanged(nameof(ShowLedColorPicker));
}

View File

@@ -6,31 +6,44 @@ namespace Ryujinx.Ava.UI.Models.Input
{
public partial class HotkeyConfig : BaseModel
{
[ObservableProperty] private Key _toggleVSyncMode;
[ObservableProperty]
public partial Key ToggleVSyncMode { get; set; }
[ObservableProperty] private Key _screenshot;
[ObservableProperty]
public partial Key Screenshot { get; set; }
[ObservableProperty] private Key _showUI;
[ObservableProperty]
public partial Key ShowUI { get; set; }
[ObservableProperty] private Key _pause;
[ObservableProperty]
public partial Key Pause { get; set; }
[ObservableProperty] private Key _toggleMute;
[ObservableProperty]
public partial Key ToggleMute { get; set; }
[ObservableProperty] private Key _resScaleUp;
[ObservableProperty]
public partial Key ResScaleUp { get; set; }
[ObservableProperty] private Key _resScaleDown;
[ObservableProperty]
public partial Key ResScaleDown { get; set; }
[ObservableProperty] private Key _volumeUp;
[ObservableProperty]
public partial Key VolumeUp { get; set; }
[ObservableProperty] private Key _volumeDown;
[ObservableProperty]
public partial Key VolumeDown { get; set; }
[ObservableProperty] private Key _customVSyncIntervalIncrement;
[ObservableProperty]
public partial Key CustomVSyncIntervalIncrement { get; set; }
[ObservableProperty] private Key _customVSyncIntervalDecrement;
[ObservableProperty]
public partial Key CustomVSyncIntervalDecrement { get; set; }
[ObservableProperty] private Key _turboMode;
[ObservableProperty]
public partial Key TurboMode { get; set; }
[ObservableProperty] private bool _turboModeWhileHeld;
[ObservableProperty]
public partial bool TurboModeWhileHeld { get; set; }
public HotkeyConfig(KeyboardHotkeys config)
{

View File

@@ -12,42 +12,89 @@ namespace Ryujinx.Ava.UI.Models.Input
public ControllerType ControllerType { get; set; }
public PlayerIndex PlayerIndex { get; set; }
[ObservableProperty] private Key _leftStickUp;
[ObservableProperty] private Key _leftStickDown;
[ObservableProperty] private Key _leftStickLeft;
[ObservableProperty] private Key _leftStickRight;
[ObservableProperty] private Key _leftStickButton;
[ObservableProperty]
public partial Key LeftStickUp { get; set; }
[ObservableProperty] private Key _rightStickUp;
[ObservableProperty] private Key _rightStickDown;
[ObservableProperty] private Key _rightStickLeft;
[ObservableProperty] private Key _rightStickRight;
[ObservableProperty] private Key _rightStickButton;
[ObservableProperty]
public partial Key LeftStickDown { get; set; }
[ObservableProperty] private Key _dpadUp;
[ObservableProperty] private Key _dpadDown;
[ObservableProperty] private Key _dpadLeft;
[ObservableProperty] private Key _dpadRight;
[ObservableProperty]
public partial Key LeftStickLeft { get; set; }
[ObservableProperty] private Key _buttonMinus;
[ObservableProperty] private Key _buttonPlus;
[ObservableProperty]
public partial Key LeftStickRight { get; set; }
[ObservableProperty] private Key _buttonA;
[ObservableProperty] private Key _buttonB;
[ObservableProperty] private Key _buttonX;
[ObservableProperty] private Key _buttonY;
[ObservableProperty]
public partial Key LeftStickButton { get; set; }
[ObservableProperty] private Key _buttonL;
[ObservableProperty] private Key _buttonR;
[ObservableProperty]
public partial Key RightStickUp { get; set; }
[ObservableProperty] private Key _buttonZl;
[ObservableProperty] private Key _buttonZr;
[ObservableProperty]
public partial Key RightStickDown { get; set; }
[ObservableProperty] private Key _leftButtonSl;
[ObservableProperty] private Key _leftButtonSr;
[ObservableProperty]
public partial Key RightStickLeft { get; set; }
[ObservableProperty] private Key _rightButtonSl;
[ObservableProperty] private Key _rightButtonSr;
[ObservableProperty]
public partial Key RightStickRight { get; set; }
[ObservableProperty]
public partial Key RightStickButton { get; set; }
[ObservableProperty]
public partial Key DpadUp { get; set; }
[ObservableProperty]
public partial Key DpadDown { get; set; }
[ObservableProperty]
public partial Key DpadLeft { get; set; }
[ObservableProperty]
public partial Key DpadRight { get; set; }
[ObservableProperty]
public partial Key ButtonMinus { get; set; }
[ObservableProperty]
public partial Key ButtonPlus { get; set; }
[ObservableProperty]
public partial Key ButtonA { get; set; }
[ObservableProperty]
public partial Key ButtonB { get; set; }
[ObservableProperty]
public partial Key ButtonX { get; set; }
[ObservableProperty]
public partial Key ButtonY { get; set; }
[ObservableProperty]
public partial Key ButtonL { get; set; }
[ObservableProperty]
public partial Key ButtonR { get; set; }
[ObservableProperty]
public partial Key ButtonZl { get; set; }
[ObservableProperty]
public partial Key ButtonZr { get; set; }
[ObservableProperty]
public partial Key LeftButtonSl { get; set; }
[ObservableProperty]
public partial Key LeftButtonSr { get; set; }
[ObservableProperty]
public partial Key RightButtonSl { get; set; }
[ObservableProperty]
public partial Key RightButtonSr { get; set; }
public KeyboardInputConfig(InputConfig config)
{

View File

@@ -6,8 +6,8 @@ namespace Ryujinx.Ava.UI.Models
{
public partial class ModModel : BaseModel
{
[ObservableProperty] private bool _enabled;
[ObservableProperty]
public partial bool Enabled { get; set; }
public bool InSd { get; }
public string Path { get; }
public string Name { get; }

View File

@@ -15,6 +15,7 @@ namespace Ryujinx.Ava.UI.Models
public string Name { get; set; }
public byte[] Data { get; set; }
[ObservableProperty] private SolidColorBrush _backgroundColor = new(Colors.White);
[ObservableProperty]
public partial SolidColorBrush BackgroundColor { get; set; } = new(Colors.White);
}
}

View File

@@ -7,24 +7,26 @@ namespace Ryujinx.Ava.UI.Models
{
public partial class TempProfile : BaseModel
{
[ObservableProperty] private byte[] _image;
[ObservableProperty] private string _name = String.Empty;
private UserId _userId;
[ObservableProperty]
public partial byte[] Image { get; set; }
[ObservableProperty]
public partial string Name { get; set; } = string.Empty;
public static uint MaxProfileNameLength => 0x20;
public UserId UserId
{
get => _userId;
get;
set
{
_userId = value;
field = value;
OnPropertyChanged();
OnPropertyChanged(nameof(UserIdString));
}
}
public string UserIdString => _userId.ToString();
public string UserIdString => UserId.ToString();
public TempProfile(UserProfile profile)
{

View File

@@ -13,11 +13,20 @@ namespace Ryujinx.Ava.UI.Models
{
private readonly Profile _profile;
private readonly NavigationDialogHost _owner;
[ObservableProperty] private byte[] _image;
[ObservableProperty] private string _name;
[ObservableProperty] private UserId _userId;
[ObservableProperty] private bool _isPointerOver;
[ObservableProperty] private IBrush _backgroundColor;
[ObservableProperty]
public partial byte[] Image { get; set; }
[ObservableProperty]
public partial string Name { get; set; }
[ObservableProperty]
public partial UserId UserId { get; set; }
[ObservableProperty]
public partial bool IsPointerOver { get; set; }
[ObservableProperty]
public partial IBrush BackgroundColor { get; set; }
public UserProfile(Profile profile, NavigationDialogHost owner)
{
@@ -39,7 +48,7 @@ namespace Ryujinx.Ava.UI.Models
private void UpdateBackground()
{
Application currentApplication = Avalonia.Application.Current;
Application currentApplication = Application.Current;
currentApplication.Styles.TryGetResource("ControlFillColorSecondary", currentApplication.ActualThemeVariant, out object color);
if (color is not null)

View File

@@ -359,8 +359,9 @@ namespace Ryujinx.Ava.UI.ViewModels
}
}
[ObservableProperty] private bool _matchSystemTime;
[ObservableProperty]
public partial bool MatchSystemTime { get; set; }
public DateTimeOffset CurrentDate { get; set; }
public TimeSpan CurrentTime { get; set; }