Skip to content

Commit

Permalink
implement dirty checking for N64 settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Morilli committed Oct 18, 2024
1 parent 13584ce commit c68dd70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public partial class N64 : ISettable<N64Settings, N64SyncSettings>
{
public N64Settings GetSettings()
{
return _settings.Clone();
return _settings with { };
}

public N64SyncSettings GetSyncSettings()
Expand All @@ -18,8 +18,9 @@ public N64SyncSettings GetSyncSettings()

public PutSettingsDirtyBits PutSettings(N64Settings o)
{
bool changed = o != _settings;
_settings = o;
return PutSettingsDirtyBits.RebootCore;
return changed ? PutSettingsDirtyBits.RebootCore : PutSettingsDirtyBits.None;
}

public PutSettingsDirtyBits PutSyncSettings(N64SyncSettings o)
Expand Down
13 changes: 1 addition & 12 deletions src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64Settings.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
namespace BizHawk.Emulation.Cores.Nintendo.N64
{
public class N64Settings
public record N64Settings
{
public int VideoSizeX = 320;
public int VideoSizeY = 240;

public bool UseMupenStyleLag { get; set; }

public N64Settings Clone()
{
return new N64Settings
{
VideoSizeX = VideoSizeX,
VideoSizeY = VideoSizeY,

UseMupenStyleLag = UseMupenStyleLag
};
}
}
}

0 comments on commit c68dd70

Please sign in to comment.