faust - some settings cleanup

This commit is contained in:
nattthebear 2020-05-29 21:19:54 -04:00
parent 3a83f6c9d0
commit 9b1cbaf4ab
3 changed files with 30 additions and 5 deletions

View File

@ -1,3 +1,4 @@
using System.Collections.Generic;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Waterbox;
@ -13,5 +14,18 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.Faust
{
DoInit<LibNymaCore>(game, rom, null, "faust.wbx", extension, deterministic);
}
protected override IDictionary<string, string> SettingsOverrides { get; } = new Dictionary<string, string>
{
{ "snes_faust.renderer", null },
{ "snes_faust.affinity.ppu", null },
{ "snes_faust.affinity.msu1.audio", null },
{ "snes_faust.affinity.msu1.data", null },
{ "snes_faust.frame_begin_vblank", null },
{ "snes_faust.msu1.resamp_quality", null },
{ "snes_faust.correct_aspect", null },
{ "nyma.rtcinitialtime", null },
{ "nyma.rtcrealtime", null },
};
}
}

View File

@ -242,15 +242,26 @@ namespace BizHawk.Emulation.Cores.Waterbox
public override Type PropertyType => typeof(ulong);
protected override object ConvertFromString(string s)
{
var ret = ulong.Parse(s);
if (Setting.Min != null && ret < ulong.Parse(Setting.Min) || Setting.Max != null && ret > ulong.Parse(Setting.Max))
ret = ulong.Parse(Setting.DefaultValue);
var ret = Parse(s);
if (Setting.Min != null && ret < Parse(Setting.Min) || Setting.Max != null && ret > Parse(Setting.Max))
ret = Parse(Setting.DefaultValue);
return ret;
}
protected override string ConvertToString(object o)
{
return o.ToString();
}
private static ulong Parse(string s)
{
if (s.StartsWith("0x"))
{
return ulong.Parse(s.Substring(2), NumberStyles.HexNumber);
}
else
{
return ulong.Parse(s);
}
}
}
public class MednaDoubleDescriptor : MednaPropertyDescriptor
{

View File

@ -100,10 +100,10 @@ namespace BizHawk.Emulation.Cores.Waterbox
protected string SettingsQuery(string name)
{
SettingsOverrides.TryGetValue(name, out var val);
var forced = SettingsOverrides.TryGetValue(name, out var val);
if (val == null)
{
if (!_syncSettingsActual.MednafenValues.TryGetValue(name, out val))
if (forced || !_syncSettingsActual.MednafenValues.TryGetValue(name, out val))
{
if (SettingsInfo.SettingsByKey.TryGetValue(name, out var info))
{