delete unused KeyTurbo.cs and misc small cleanups to InputAdapters

This commit is contained in:
adelikat 2020-02-22 12:44:03 -06:00
parent f9c6234262
commit c3811721c2
7 changed files with 129 additions and 166 deletions

View File

@ -177,7 +177,7 @@ namespace BizHawk.Client.Common
}
}
public void Overrides(OverrideAdaptor controller)
public void Overrides(OverrideAdapter controller)
{
foreach (var button in controller.Overrides)
{

View File

@ -43,7 +43,7 @@ namespace BizHawk.Client.Common
// the "output" port for the controller chain.
public static readonly CopyControllerAdapter ControllerOutput = new CopyControllerAdapter();
public static readonly UD_LR_ControllerAdapter UD_LR_ControllerAdapter = new UD_LR_ControllerAdapter();
public static readonly UdlrControllerAdapter UD_LR_ControllerAdapter = new UdlrControllerAdapter();
public static readonly AutoFireStickyXorAdapter AutofireStickyXORAdapter = new AutoFireStickyXorAdapter();
@ -55,7 +55,7 @@ namespace BizHawk.Client.Common
/// <summary>
/// Used to AND to another controller, used for <see cref="JoypadApi.Set(System.Collections.Generic.Dictionary{string,bool},System.Nullable{int})">JoypadApi.Set</see>
/// </summary>
public static readonly OverrideAdaptor ButtonOverrideAdaptor = new OverrideAdaptor();
public static readonly OverrideAdapter ButtonOverrideAdaptor = new OverrideAdapter();
/// <summary>
/// fire off one-frame logical button clicks here. useful for things like ti-83 virtual pad and reset buttons

View File

@ -1,40 +0,0 @@
namespace BizHawk.Client.Common
{
public class TurboKey
{
private int _upTime, _downTime, _timer;
public bool Value { get; set; }
public void Reset(int downTime, int upTime)
{
Value = false;
_timer = 0;
_upTime = upTime;
_downTime = downTime;
}
public void Tick(bool down)
{
if (!down)
{
Reset(_downTime, _upTime);
return;
}
_timer++;
Value = true;
if (_timer > _downTime)
{
Value = false;
}
if (_timer > _upTime + _downTime)
{
_timer = 0;
Value = true;
}
}
}
}

View File

@ -4,7 +4,6 @@
{
public AutoPatternBool()
{
Pattern = new[] { true };
}
/// <summary>
@ -34,7 +33,7 @@
private int _index;
public bool SkipsLag { get; } = true;
public bool[] Pattern { get; }
public bool[] Pattern { get; } = { true };
public int Loop { get; }
/// <summary>
@ -77,7 +76,6 @@
/// </summary>
public AutoPatternFloat()
{
Pattern = new[] { 0f };
}
/// <summary>
@ -112,7 +110,7 @@
private int _index;
public bool SkipsLag { get; } = true;
public float[] Pattern { get; }
public float[] Pattern { get; } = { 0f };
public int Loop { get; }
/// <summary>

View File

@ -9,7 +9,7 @@ namespace BizHawk.Client.Common
/// Used to pass into an Override method to manage the logic overriding input
/// This only works with bool buttons!
/// </summary>
public class OverrideAdaptor : IController
public class OverrideAdapter : IController
{
public ControllerDefinition Definition { get; private set; }

View File

@ -9,7 +9,7 @@ namespace BizHawk.Client.Common
/// Filters input for things called Up and Down while considering the client's AllowUD_LR option.
/// This is a bit gross but it is unclear how to do it more nicely
/// </summary>
public class UD_LR_ControllerAdapter : IController
public class UdlrControllerAdapter : IController
{
public ControllerDefinition Definition => Source.Definition;

View File

@ -338,6 +338,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=Multitap/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Multitrack/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mupen/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=mutexing/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=muxed/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Nametable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Nametables/@EntryIndexedValue">True</s:Boolean>
@ -356,6 +357,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=Overscan/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=palettized/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Palletize/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=passthru/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=PCFX/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=PCSX/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=performant/@EntryIndexedValue">True</s:Boolean>
@ -428,6 +430,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=Turboing/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=tvalue/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=UDLR/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Unclick/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=underrun/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Underruns/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=undriven/@EntryIndexedValue">True</s:Boolean>
@ -439,6 +442,8 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=unpaused/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Unpausing/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unpress/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unpresses/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unpressing/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Unregister/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unseekable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Unthrottle/@EntryIndexedValue">True</s:Boolean>