Files
MesenCE/UI/Config/EmulationConfig.cs
SourMesen 40335ce735 UI: Update to Avalonia 12, .NET 10 and replace ReactiveUI with MVVM community toolkit (#142)
Also fixes DX11.0 support (for Win7 PCs that aren't fully updated), which stopped working after the recent variable refresh rate changes
2026-07-03 16:04:42 +09:00

57 lines
1.3 KiB
C#

using CommunityToolkit.Mvvm.ComponentModel;
using Mesen.Interop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace Mesen.Config
{
public partial class EmulationConfig : BaseConfig<EmulationConfig>
{
[ObservableProperty][MinMax(0, 5000)] public partial UInt32 EmulationSpeed { get; set; } = 100;
[ObservableProperty][MinMax(0, 5000)] public partial UInt32 TurboSpeed { get; set; } = 300;
[ObservableProperty][MinMax(0, 5000)] public partial UInt32 RewindSpeed { get; set; } = 100;
[ObservableProperty][MinMax(0, 10)] public partial UInt32 RunAheadFrames { get; set; } = 0;
public void ApplyConfig()
{
ConfigApi.SetEmulationConfig(new InteropEmulationConfig() {
EmulationSpeed = this.EmulationSpeed,
TurboSpeed = this.TurboSpeed,
RewindSpeed = this.RewindSpeed,
RunAheadFrames = this.RunAheadFrames
});
}
}
[StructLayout(LayoutKind.Sequential)]
public struct InteropEmulationConfig
{
public UInt32 EmulationSpeed;
public UInt32 TurboSpeed;
public UInt32 RewindSpeed;
public UInt32 RunAheadFrames;
}
public enum ConsoleRegion
{
Auto = 0,
Ntsc = 1,
Pal = 2,
Dendy = 3,
NtscJapan = 4
}
public enum RamState
{
Random = 0,
AllZeros = 1,
AllOnes = 2,
}
}