some bk2 code cleanup
This commit is contained in:
parent
dfea029fe4
commit
e930dd3326
|
@ -10,11 +10,11 @@ namespace BizHawk.Client.Common
|
||||||
public class Bk2ControllerAdapter : IMovieController
|
public class Bk2ControllerAdapter : IMovieController
|
||||||
{
|
{
|
||||||
private readonly string _logKey = "";
|
private readonly string _logKey = "";
|
||||||
private readonly WorkingDictionary<string, bool> MyBoolButtons = new WorkingDictionary<string, bool>();
|
private readonly WorkingDictionary<string, bool> _myBoolButtons = new WorkingDictionary<string, bool>();
|
||||||
private readonly WorkingDictionary<string, float> MyFloatControls = new WorkingDictionary<string, float>();
|
private readonly WorkingDictionary<string, float> _myFloatControls = new WorkingDictionary<string, float>();
|
||||||
|
|
||||||
public Bk2ControllerAdapter()
|
public Bk2ControllerAdapter()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bk2ControllerAdapter(string key)
|
public Bk2ControllerAdapter(string key)
|
||||||
|
@ -41,14 +41,14 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return MyBoolButtons[button];
|
return _myBoolButtons[button];
|
||||||
}
|
}
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (MyBoolButtons.ContainsKey(button))
|
if (_myBoolButtons.ContainsKey(button))
|
||||||
{
|
{
|
||||||
MyBoolButtons[button] = value;
|
_myBoolButtons[button] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,12 +57,12 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public bool IsPressed(string button)
|
public bool IsPressed(string button)
|
||||||
{
|
{
|
||||||
return MyBoolButtons[button];
|
return _myBoolButtons[button];
|
||||||
}
|
}
|
||||||
|
|
||||||
public float GetFloat(string name)
|
public float GetFloat(string name)
|
||||||
{
|
{
|
||||||
return MyFloatControls[name];
|
return _myFloatControls[name];
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -104,7 +104,7 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
var val = playerSource.IsPressed(button);
|
var val = playerSource.IsPressed(button);
|
||||||
MyBoolButtons[button] = val;
|
_myBoolButtons[button] = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var button in Definition.FloatControls)
|
foreach (var button in Definition.FloatControls)
|
||||||
|
@ -122,7 +122,7 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
var val = playerSource.GetFloat(button);
|
var val = playerSource.GetFloat(button);
|
||||||
|
|
||||||
MyFloatControls[button] = val;
|
_myFloatControls[button] = val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,12 +133,12 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
foreach (var button in Definition.BoolButtons)
|
foreach (var button in Definition.BoolButtons)
|
||||||
{
|
{
|
||||||
MyBoolButtons[button] = source.IsPressed(button);
|
_myBoolButtons[button] = source.IsPressed(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var name in Definition.FloatControls)
|
foreach (var name in Definition.FloatControls)
|
||||||
{
|
{
|
||||||
MyFloatControls[name] = source.GetFloat(name);
|
_myFloatControls[name] = source.GetFloat(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
foreach (var button in Definition.BoolButtons)
|
foreach (var button in Definition.BoolButtons)
|
||||||
{
|
{
|
||||||
MyBoolButtons[button] = Global.AutofireStickyXORAdapter.IsSticky(button);
|
_myBoolButtons[button] = Global.AutofireStickyXORAdapter.IsSticky(button);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,14 +169,14 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
if (def.BoolButtons.Contains(key))
|
if (def.BoolButtons.Contains(key))
|
||||||
{
|
{
|
||||||
MyBoolButtons[key] = trimmed[iterator] != '.';
|
_myBoolButtons[key] = trimmed[iterator] != '.';
|
||||||
iterator++;
|
iterator++;
|
||||||
}
|
}
|
||||||
else if (def.FloatControls.Contains(key))
|
else if (def.FloatControls.Contains(key))
|
||||||
{
|
{
|
||||||
var temp = trimmed.Substring(iterator, 5);
|
var temp = trimmed.Substring(iterator, 5);
|
||||||
var val = int.Parse(temp.Trim());
|
var val = int.Parse(temp.Trim());
|
||||||
MyFloatControls[key] = val;
|
_myFloatControls[key] = val;
|
||||||
|
|
||||||
iterator += 6;
|
iterator += 6;
|
||||||
}
|
}
|
||||||
|
@ -188,23 +188,21 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public void SetFloat(string buttonName, float value)
|
public void SetFloat(string buttonName, float value)
|
||||||
{
|
{
|
||||||
MyFloatControls[buttonName] = value;
|
_myFloatControls[buttonName] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Bk2ControllerDefinition : ControllerDefinition
|
public class Bk2ControllerDefinition : ControllerDefinition
|
||||||
{
|
{
|
||||||
public Bk2ControllerDefinition()
|
public Bk2ControllerDefinition()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bk2ControllerDefinition(ControllerDefinition source)
|
public Bk2ControllerDefinition(ControllerDefinition source)
|
||||||
: base(source)
|
: base(source)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<List<string>> ControlsFromLog = new List<List<string>>();
|
public List<List<string>> ControlsFromLog { private get; set; } = new List<List<string>>();
|
||||||
|
|
||||||
public override IEnumerable<IEnumerable<string>> ControlsOrdered
|
public override IEnumerable<IEnumerable<string>> ControlsOrdered
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,34 +30,34 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly Dictionary<string, string> BaseMnemonicLookupTable = new Dictionary<string, string>
|
private readonly Dictionary<string, string> BaseMnemonicLookupTable = new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ "Zapper X", "zapX" },
|
{ "Zapper X", "zapX" },
|
||||||
{ "Zapper Y", "zapY" },
|
{ "Zapper Y", "zapY" },
|
||||||
{ "Paddle", "Pad" },
|
{ "Paddle", "Pad" },
|
||||||
{ "Pen", "Pen" },
|
{ "Pen", "Pen" },
|
||||||
{ "Mouse X", "mX" },
|
{ "Mouse X", "mX" },
|
||||||
{ "Mouse Y", "mY" },
|
{ "Mouse Y", "mY" },
|
||||||
{ "Lightgun X", "lX" },
|
{ "Lightgun X", "lX" },
|
||||||
{ "Lightgun Y", "lY" },
|
{ "Lightgun Y", "lY" },
|
||||||
{ "X Axis", "aX" },
|
{ "X Axis", "aX" },
|
||||||
{ "Y Axis", "aY" },
|
{ "Y Axis", "aY" },
|
||||||
{ "LStick X", "lsX" },
|
{ "LStick X", "lsX" },
|
||||||
{ "LStick Y", "lsY" },
|
{ "LStick Y", "lsY" },
|
||||||
{ "RStick X", "rsX" },
|
{ "RStick X", "rsX" },
|
||||||
{ "RStick Y", "rsY" },
|
{ "RStick Y", "rsY" },
|
||||||
{ "Disc Select", "Disc" }
|
{ "Disc Select", "Disc" }
|
||||||
};
|
};
|
||||||
|
|
||||||
private readonly Dictionary<string, Dictionary<string, string>> SystemOverrides = new Dictionary<string, Dictionary<string, string>>
|
private readonly Dictionary<string, Dictionary<string, string>> SystemOverrides = new Dictionary<string, Dictionary<string, string>>
|
||||||
|
{
|
||||||
{
|
{
|
||||||
|
"A78",
|
||||||
|
new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
"A78",
|
{ "VPos", "X" },
|
||||||
new Dictionary<string, string>
|
{ "HPos", "Y" }
|
||||||
{
|
}
|
||||||
{ "VPos", "X" },
|
},
|
||||||
{ "HPos", "Y" }
|
};
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,8 @@ namespace BizHawk.Client.Common
|
||||||
private readonly Bk2MnemonicConstants Mnemonics = new Bk2MnemonicConstants();
|
private readonly Bk2MnemonicConstants Mnemonics = new Bk2MnemonicConstants();
|
||||||
private readonly Bk2FloatConstants FloatLookup = new Bk2FloatConstants();
|
private readonly Bk2FloatConstants FloatLookup = new Bk2FloatConstants();
|
||||||
|
|
||||||
|
private readonly string _logKey;
|
||||||
private IController _source;
|
private IController _source;
|
||||||
private readonly string _logKey = "";
|
|
||||||
|
|
||||||
public Bk2LogEntryGenerator(string logKey)
|
public Bk2LogEntryGenerator(string logKey)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
// ReSharper disable StyleCop.SA1509
|
||||||
namespace BizHawk.Client.Common
|
namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
public class Bk2MnemonicConstants
|
public class Bk2MnemonicConstants
|
||||||
|
@ -14,14 +15,14 @@ namespace BizHawk.Client.Common
|
||||||
key = key.Substring(3);
|
key = key.Substring(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SystemOverrides.ContainsKey(Global.Emulator.SystemId) && SystemOverrides[Global.Emulator.SystemId].ContainsKey(key))
|
if (_systemOverrides.ContainsKey(Global.Emulator.SystemId) && _systemOverrides[Global.Emulator.SystemId].ContainsKey(key))
|
||||||
{
|
{
|
||||||
return SystemOverrides[Global.Emulator.SystemId][key];
|
return _systemOverrides[Global.Emulator.SystemId][key];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BaseMnemonicLookupTable.ContainsKey(key))
|
if (_baseMnemonicLookupTable.ContainsKey(key))
|
||||||
{
|
{
|
||||||
return BaseMnemonicLookupTable[key];
|
return _baseMnemonicLookupTable[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key.Length == 1)
|
if (key.Length == 1)
|
||||||
|
@ -33,336 +34,304 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly Dictionary<string, char> BaseMnemonicLookupTable = new Dictionary<string, char>
|
private readonly Dictionary<string, char> _baseMnemonicLookupTable = new Dictionary<string, char>
|
||||||
{
|
{
|
||||||
{ "Power", 'P' },
|
["Power"] = 'P',
|
||||||
{ "Reset", 'r' },
|
["Reset"] = 'r',
|
||||||
{ "Pause", 'p' },
|
["Pause"] = 'p',
|
||||||
{ "Rotate", 'R' },
|
["Rotate"] = 'R',
|
||||||
|
|
||||||
{ "Up", 'U' },
|
["Up"] = 'U',
|
||||||
{ "Down", 'D' },
|
["Down"] = 'D',
|
||||||
{ "Left", 'L' },
|
["Left"] = 'L',
|
||||||
{ "Right", 'R' },
|
["Right"] = 'R',
|
||||||
|
|
||||||
{ "A", 'A' },
|
["A"] = 'A',
|
||||||
{ "B", 'B' },
|
["B"] = 'B',
|
||||||
{ "C", 'C' },
|
["C"] = 'C',
|
||||||
|
|
||||||
{ "X", 'X' },
|
["X"] = 'X',
|
||||||
{ "Y", 'Y' },
|
["Y"] = 'Y',
|
||||||
{ "Z", 'Z' },
|
["Z"] = 'Z',
|
||||||
|
|
||||||
{ "Select", 's' },
|
["Select"] = 's',
|
||||||
{ "Start", 'S' },
|
["Start"] = 'S',
|
||||||
{ "Run", 'R' },
|
["Run"] = 'R',
|
||||||
|
|
||||||
{ "L", 'l' },
|
["L"] = 'l',
|
||||||
{ "R", 'r' },
|
["R"] = 'r',
|
||||||
|
|
||||||
{ "L1", 'l' },
|
["L1"] = 'l',
|
||||||
{ "R1", 'r' },
|
["R1"] = 'r',
|
||||||
|
|
||||||
{ "L2", 'L' },
|
["L2"] = 'L',
|
||||||
{ "R2", 'R' },
|
["R2"] = 'R',
|
||||||
|
|
||||||
{ "L3", '<' },
|
["L3"] = '<',
|
||||||
{ "R3", '>' },
|
["R3"] = '>',
|
||||||
|
|
||||||
{ "Button", 'B' },
|
["Button"] = 'B',
|
||||||
{ "B1", '1' },
|
["B1"] = '1',
|
||||||
{ "B2", '2' },
|
["B2"] = '2',
|
||||||
|
|
||||||
{ "Trigger", '1' },
|
["Trigger"] = '1',
|
||||||
{ "Trigger 1", '1' },
|
["Trigger 1"] = '1',
|
||||||
{ "Trigger 2", '2' },
|
["Trigger 2"] = '2',
|
||||||
|
|
||||||
{ "Mouse Left", 'l' },
|
["Mouse Left"] = 'l',
|
||||||
{ "Mouse Right", 'r' },
|
["Mouse Right"] = 'r',
|
||||||
{ "Mouse Center", 'c' },
|
["Mouse Center"] = 'c',
|
||||||
{ "Mouse Start", 's' },
|
["Mouse Start"] = 's',
|
||||||
|
|
||||||
{ "Mode", 'M' },
|
["Mode"] = 'M',
|
||||||
{ "MODE", 'M' },
|
["MODE"] = 'M',
|
||||||
|
|
||||||
{ "Fire", 'F' },
|
["Fire"] = 'F',
|
||||||
{ "Lightgun Trigger", 'T' },
|
["Lightgun Trigger"] = 'T',
|
||||||
{ "Lightgun Start", 'S' },
|
["Lightgun Start"] = 'S',
|
||||||
{ "Lightgun B", 'B' },
|
["Lightgun B"] = 'B',
|
||||||
{ "Lightgun C", 'C' },
|
["Lightgun C"] = 'C',
|
||||||
{ "Microphone", 'M' },
|
["Microphone"] = 'M',
|
||||||
|
|
||||||
{ "Star", '*' },
|
["Star"] = '*',
|
||||||
{ "Pound", '#' },
|
["Pound"] = '#',
|
||||||
|
|
||||||
{ "X1", '1' },
|
["X1"] = '1',
|
||||||
{ "X2", '2' },
|
["X2"] = '2',
|
||||||
{ "X3", '3' },
|
["X3"] = '3',
|
||||||
{ "X4", '4' },
|
["X4"] = '4',
|
||||||
|
|
||||||
{ "Y1", '1' },
|
["Y1"] = '1',
|
||||||
{ "Y2", '2' },
|
["Y2"] = '2',
|
||||||
{ "Y3", '3' },
|
["Y3"] = '3',
|
||||||
{ "Y4", '4' },
|
["Y4"] = '4',
|
||||||
|
|
||||||
{ "Triangle", 'T' },
|
["Triangle"] = 'T',
|
||||||
{ "Circle", 'O' },
|
["Circle"] = 'O',
|
||||||
{ "Cross", 'X' },
|
["Cross"] = 'X',
|
||||||
{ "Square", 'Q' },
|
["Square"] = 'Q',
|
||||||
|
|
||||||
{ "Toggle Left Difficulty", 'l' },
|
["Toggle Left Difficulty"] = 'l',
|
||||||
{ "Toggle Right Difficulty", 'r' },
|
["Toggle Right Difficulty"] = 'r',
|
||||||
|
|
||||||
{ "Open", 'O' },
|
["Open"] = 'O',
|
||||||
{ "Close", 'C' },
|
["Close"] = 'C',
|
||||||
{ "Pedal", 'P' }
|
["Pedal"] = 'P'
|
||||||
};
|
};
|
||||||
|
|
||||||
private readonly Dictionary<string, Dictionary<string, char>> SystemOverrides = new Dictionary<string, Dictionary<string, char>>
|
private readonly Dictionary<string, Dictionary<string, char>> _systemOverrides = new Dictionary<string, Dictionary<string, char>>
|
||||||
|
{
|
||||||
|
["NES"] = new Dictionary<string, char>
|
||||||
{
|
{
|
||||||
{
|
["FDS Eject"] = 'E',
|
||||||
"NES",
|
["FDS Insert 0"] = '0',
|
||||||
new Dictionary<string, char>
|
["FDS Insert 1"] = '1',
|
||||||
{
|
["Insert Coin P1"] = 'c',
|
||||||
{ "FDS Eject", 'E' },
|
["Insert Coin P2"] = 'C',
|
||||||
{ "FDS Insert 0", '0' },
|
["Service Switch"] = 'w',
|
||||||
{ "FDS Insert 1", '1' },
|
|
||||||
{ "Insert Coin P1", 'c' },
|
|
||||||
{ "Insert Coin P2", 'C' },
|
|
||||||
{ "Service Switch", 'w' },
|
|
||||||
|
|
||||||
{ "PP1", '1' },
|
["PP1"] = '1',
|
||||||
{ "PP2", '2' },
|
["PP2"] = '2',
|
||||||
{ "PP3", '3' },
|
["PP3"] = '3',
|
||||||
{ "PP4", '4' },
|
["PP4"] = '4',
|
||||||
|
|
||||||
{ "PP5", '5' },
|
["PP5"] = '5',
|
||||||
{ "PP6", '6' },
|
["PP6"] = '6',
|
||||||
{ "PP7", '7' },
|
["PP7"] = '7',
|
||||||
{ "PP8", '8' },
|
["PP8"] = '8',
|
||||||
|
|
||||||
{ "PP9", '9' },
|
["PP9"] = '9',
|
||||||
{ "PP10", 'A' },
|
["PP10"] = 'A',
|
||||||
{ "PP11", 'B' },
|
["PP11"] = 'B',
|
||||||
{ "PP12", 'C' },
|
["PP12"] = 'C',
|
||||||
{ "Click", 'C' },
|
["Click"] = 'C',
|
||||||
{ "Touch", 'T' },
|
["Touch"] = 'T',
|
||||||
}
|
},
|
||||||
},
|
["SNES"] = new Dictionary<string, char>
|
||||||
{
|
{
|
||||||
"SNES",
|
["Cursor"] = 'c',
|
||||||
new Dictionary<string, char>
|
["Turbo"] = 't',
|
||||||
{
|
["Toggle Multitap"] = 't',
|
||||||
{ "Cursor", 'c' },
|
|
||||||
{ "Turbo", 't' },
|
|
||||||
{ "Toggle Multitap", 't' },
|
|
||||||
|
|
||||||
{ "B0", '0' },
|
["B0"] = '0',
|
||||||
{ "B1", '1' },
|
["B1"] = '1',
|
||||||
{ "B2", '2' },
|
["B2"] = '2',
|
||||||
{ "B3", '3' },
|
["B3"] = '3',
|
||||||
{ "B4", '4' },
|
["B4"] = '4',
|
||||||
{ "B5", '5' },
|
["B5"] = '5',
|
||||||
{ "B6", '6' },
|
["B6"] = '6',
|
||||||
{ "B7", '7' },
|
["B7"] = '7',
|
||||||
{ "B8", '8' },
|
["B8"] = '8',
|
||||||
{ "B9", '9' },
|
["B9"] = '9',
|
||||||
{ "B10", 'a' },
|
["B10"] = 'a',
|
||||||
|
["B11"] = 'b',
|
||||||
|
["B12"] = 'c',
|
||||||
|
["B13"] = 'd',
|
||||||
|
["B14"] = 'e',
|
||||||
|
["B15"] = 'f',
|
||||||
|
["B16"] = 'g',
|
||||||
|
["B17"] = 'h',
|
||||||
|
["B18"] = 'i',
|
||||||
|
["B19"] = 'j',
|
||||||
|
["B20"] = 'k',
|
||||||
|
["B21"] = 'l',
|
||||||
|
["B22"] = 'm',
|
||||||
|
["B23"] = 'n',
|
||||||
|
["B24"] = 'o',
|
||||||
|
["B25"] = 'p',
|
||||||
|
["B26"] = 'q',
|
||||||
|
["B27"] = 'r',
|
||||||
|
["B28"] = 's',
|
||||||
|
["B29"] = 't',
|
||||||
|
["B30"] = 'u',
|
||||||
|
["B31"] = 'v'
|
||||||
|
},
|
||||||
|
["TI83"] = new Dictionary<string, char>
|
||||||
|
{
|
||||||
|
["UP"] = 'U',
|
||||||
|
["DOWN"] = 'D',
|
||||||
|
["LEFT"] = 'L',
|
||||||
|
["RIGHT"] = 'R',
|
||||||
|
["DOT"] = '`',
|
||||||
|
["ON"] = 'O',
|
||||||
|
["ENTER"] = '=',
|
||||||
|
["PLUS"] = '+',
|
||||||
|
["MINUS"] = '_',
|
||||||
|
["MULTIPLY"] = '*',
|
||||||
|
["DIVIDE"] = '/',
|
||||||
|
["CLEAR"] = 'c',
|
||||||
|
["EXP"] = '^',
|
||||||
|
["DASH"] = '-',
|
||||||
|
["PARAOPEN"] = '(',
|
||||||
|
["PARACLOSE"] = ')',
|
||||||
|
["TAN"] = 'T',
|
||||||
|
["VARS"] = 'V',
|
||||||
|
["COS"] = 'C',
|
||||||
|
["PRGM"] = 'P',
|
||||||
|
["STAT"] = 's',
|
||||||
|
["MATRIX"] = 'm',
|
||||||
|
["X"] = 'X',
|
||||||
|
["STO"] = '>',
|
||||||
|
["LN"] = 'n',
|
||||||
|
["LOG"] = 'L',
|
||||||
|
["SQUARED"] = '2',
|
||||||
|
["NEG1"] = '1',
|
||||||
|
["MATH"] = 'H',
|
||||||
|
["ALPHA"] = 'A',
|
||||||
|
["GRAPH"] = 'G',
|
||||||
|
["TRACE"] = 't',
|
||||||
|
["ZOOM"] = 'Z',
|
||||||
|
["WINDOW"] = 'W',
|
||||||
|
["Y"] = 'Y',
|
||||||
|
["2ND"] = '&',
|
||||||
|
["MODE"] = 'O',
|
||||||
|
["DEL"] = 'D',
|
||||||
|
["COMMA"] = ',',
|
||||||
|
["SIN"] = 'S'
|
||||||
|
},
|
||||||
|
["C64"] = new Dictionary<string, char>
|
||||||
|
{
|
||||||
|
["L"] = 'L',
|
||||||
|
["R"] = 'R',
|
||||||
|
["F1"] = '1',
|
||||||
|
["F3"] = '3',
|
||||||
|
["F5"] = '5',
|
||||||
|
["F7"] = '7',
|
||||||
|
["Left Arrow"] = 'l',
|
||||||
|
["Plus"] = '+',
|
||||||
|
["Minus"] = '-',
|
||||||
|
["Pound"] = 'l',
|
||||||
|
["Clear/Home"] = 'c',
|
||||||
|
["Insert/Delete"] = 'i',
|
||||||
|
["Control"] = 'c',
|
||||||
|
["At"] = '@',
|
||||||
|
["Asterisk"] = '*',
|
||||||
|
["Up Arrow"] = 'u',
|
||||||
|
["Restore"] = 'r',
|
||||||
|
["Run/Stop"] = 's',
|
||||||
|
["Lck"] = 'k',
|
||||||
|
["Colon"] = ':',
|
||||||
|
["Semicolon"] = ';',
|
||||||
|
["Equal"] = '=',
|
||||||
|
["Return"] = 'e',
|
||||||
|
["Commodore"] = 'o',
|
||||||
|
["Left Shift"] = 's',
|
||||||
|
["Comma"] = ',',
|
||||||
|
["Period"] = '>',
|
||||||
|
["Slash"] = '/',
|
||||||
|
["Right Shift"] = 's',
|
||||||
|
["Cursor Up/Down"] = 'u',
|
||||||
|
["Cursor Left/Right"] = 'l',
|
||||||
|
["Space"] = '_'
|
||||||
|
},
|
||||||
|
["N64"] = new Dictionary<string, char>
|
||||||
|
{
|
||||||
|
["C Up"] = 'u',
|
||||||
|
["C Down"] = 'd',
|
||||||
|
["C Left"] = 'l',
|
||||||
|
["C Right"] = 'r',
|
||||||
|
|
||||||
{ "B11", 'b' },
|
["A Up"] = 'U',
|
||||||
{ "B12", 'c' },
|
["A Down"] = 'D',
|
||||||
{ "B13", 'd' },
|
["A Left"] = 'L',
|
||||||
{ "B14", 'e' },
|
["A Right"] = 'R',
|
||||||
{ "B15", 'f' },
|
|
||||||
{ "B16", 'g' },
|
|
||||||
{ "B17", 'h' },
|
|
||||||
{ "B18", 'i' },
|
|
||||||
{ "B19", 'j' },
|
|
||||||
{ "B20", 'k' },
|
|
||||||
|
|
||||||
{ "B21", 'l' },
|
["DPad U"] = 'U',
|
||||||
{ "B22", 'm' },
|
["DPad D"] = 'D',
|
||||||
{ "B23", 'n' },
|
["DPad L"] = 'L',
|
||||||
{ "B24", 'o' },
|
["DPad R"] = 'R',
|
||||||
{ "B25", 'p' },
|
},
|
||||||
{ "B26", 'q' },
|
["DGB"] = new Dictionary<string, char>
|
||||||
{ "B27", 'r' },
|
{
|
||||||
{ "B28", 's' },
|
["Toggle Cable"] = 'L'
|
||||||
{ "B29", 't' },
|
},
|
||||||
{ "B30", 'u' },
|
["Lynx"] = new Dictionary<string, char>
|
||||||
{ "B31", 'v' }
|
{
|
||||||
}
|
["Option 1"] = '1',
|
||||||
},
|
["Option 2"] = '2'
|
||||||
{
|
},
|
||||||
"TI83",
|
["AppleII"] = new Dictionary<string, char>
|
||||||
new Dictionary<string, char>
|
{
|
||||||
{
|
["Tab"] = 't' ,
|
||||||
{ "UP", 'U' },
|
["Return"] = 'e' ,
|
||||||
{ "DOWN", 'D' },
|
["Escape"] = 'x' ,
|
||||||
{ "LEFT", 'L' },
|
["Delete"] = 'b' ,
|
||||||
{ "RIGHT", 'R' },
|
["Space"] = 's' ,
|
||||||
{ "DOT", '`' },
|
["Control"] = 'c' ,
|
||||||
{ "ON", 'O' },
|
["Shift"] = '^' ,
|
||||||
{ "ENTER", '=' },
|
["Caps Lock"] = 'C' ,
|
||||||
{ "PLUS", '+' },
|
["Next Disk"] = '>' ,
|
||||||
{ "MINUS", '_' },
|
["Previous Disk"] = '<' ,
|
||||||
{ "MULTIPLY", '*' },
|
["White Apple"] = 'w' ,
|
||||||
{ "DIVIDE", '/' },
|
["Black Apple"] = 'b' ,
|
||||||
{ "CLEAR", 'c' },
|
["L"] = 'L' ,
|
||||||
{ "EXP", '^' },
|
["R"] = 'R'
|
||||||
{ "DASH", '-' },
|
},
|
||||||
{ "PARAOPEN", '(' },
|
["INTV"] = new Dictionary<string, char>
|
||||||
{ "PARACLOSE", ')' },
|
{
|
||||||
{ "TAN", 'T' },
|
["Clear"] = 'C' ,
|
||||||
{ "VARS", 'V' },
|
["Enter"] = 'E' ,
|
||||||
{ "COS", 'C' },
|
["Top"] = 'T' ,
|
||||||
{ "PRGM", 'P' },
|
["NNE"] = 'n' ,
|
||||||
{ "STAT", 's' },
|
["NE"] = '/' ,
|
||||||
{ "MATRIX", 'm' },
|
["ENE"] = 'e' ,
|
||||||
{ "X", 'X' },
|
["ESE"] = 'e' ,
|
||||||
{ "STO", '>' },
|
["SE"] = '\\' ,
|
||||||
{ "LN", 'n' },
|
["SSE"] = 's' ,
|
||||||
{ "LOG", 'L' },
|
["SSW"] = 's' ,
|
||||||
{ "SQUARED", '2' },
|
["SW"] = '/' ,
|
||||||
{ "NEG1", '1' },
|
["WSW"] = 'w' ,
|
||||||
{ "MATH", 'H' },
|
["WNW"] = 'w' ,
|
||||||
{ "ALPHA", 'A' },
|
["NW"] = '\\' ,
|
||||||
{ "GRAPH", 'G' },
|
["NNW"] = 'n'
|
||||||
{ "TRACE", 't' },
|
},
|
||||||
{ "ZOOM", 'Z' },
|
["Coleco"] = new Dictionary<string, char>
|
||||||
{ "WINDOW", 'W' },
|
{
|
||||||
{ "Y", 'Y' },
|
["Yellow"] = 'Y',
|
||||||
{ "2ND", '&' },
|
["Red"] = 'R',
|
||||||
{ "MODE", 'O' },
|
["Blue"] = 'B',
|
||||||
{ "DEL", 'D' },
|
["Purple"] = 'P'
|
||||||
{ "COMMA", ',' },
|
}
|
||||||
{ "SIN", 'S' }
|
};
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"C64",
|
|
||||||
new Dictionary<string, char>
|
|
||||||
{
|
|
||||||
{ "L", 'L' },
|
|
||||||
{ "R", 'R' },
|
|
||||||
{ "F1", '1' },
|
|
||||||
{ "F3", '3' },
|
|
||||||
{ "F5", '5' },
|
|
||||||
{ "F7", '7' },
|
|
||||||
{ "Left Arrow", 'l' },
|
|
||||||
{ "Plus", '+' },
|
|
||||||
{ "Minus", '-' },
|
|
||||||
{ "Pound", 'l' },
|
|
||||||
{ "Clear/Home", 'c' },
|
|
||||||
{ "Insert/Delete", 'i' },
|
|
||||||
{ "Control", 'c' },
|
|
||||||
{ "At", '@' },
|
|
||||||
{ "Asterisk", '*' },
|
|
||||||
{ "Up Arrow", 'u' },
|
|
||||||
{ "Restore", 'r' },
|
|
||||||
{ "Run/Stop", 's' },
|
|
||||||
{ "Lck", 'k' },
|
|
||||||
{ "Colon", ':' },
|
|
||||||
{ "Semicolon", ';' },
|
|
||||||
{ "Equal", '=' },
|
|
||||||
{ "Return", 'e' },
|
|
||||||
{ "Commodore", 'o' },
|
|
||||||
{ "Left Shift", 's' },
|
|
||||||
{ "Comma", ',' },
|
|
||||||
{ "Period", '>' },
|
|
||||||
{ "Slash", '/' },
|
|
||||||
{ "Right Shift", 's' },
|
|
||||||
{ "Cursor Up/Down", 'u' },
|
|
||||||
{ "Cursor Left/Right", 'l' },
|
|
||||||
{ "Space", '_' }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"N64",
|
|
||||||
new Dictionary<string, char>
|
|
||||||
{
|
|
||||||
{ "C Up", 'u' },
|
|
||||||
{ "C Down", 'd' },
|
|
||||||
{ "C Left", 'l' },
|
|
||||||
{ "C Right", 'r' },
|
|
||||||
|
|
||||||
{ "A Up", 'U' },
|
|
||||||
{ "A Down", 'D' },
|
|
||||||
{ "A Left", 'L' },
|
|
||||||
{ "A Right", 'R' },
|
|
||||||
|
|
||||||
{ "DPad U", 'U' },
|
|
||||||
{ "DPad D", 'D' },
|
|
||||||
{ "DPad L", 'L' },
|
|
||||||
{ "DPad R", 'R' },
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"DGB",
|
|
||||||
new Dictionary<string, char>
|
|
||||||
{
|
|
||||||
{ "Toggle Cable", 'L' },
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Lynx",
|
|
||||||
new Dictionary<string, char>
|
|
||||||
{
|
|
||||||
{ "Option 1", '1' },
|
|
||||||
{ "Option 2", '2' }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"AppleII",
|
|
||||||
new Dictionary<string, char>
|
|
||||||
{
|
|
||||||
{ "Tab", 't' },
|
|
||||||
{ "Return", 'e' },
|
|
||||||
{ "Escape", 'x' },
|
|
||||||
{ "Delete", 'b' },
|
|
||||||
{ "Space", 's' },
|
|
||||||
{ "Control", 'c' },
|
|
||||||
{ "Shift", '^' },
|
|
||||||
{ "Caps Lock", 'C' },
|
|
||||||
{ "Next Disk", '>' },
|
|
||||||
{ "Previous Disk", '<' },
|
|
||||||
{ "White Apple", 'w' },
|
|
||||||
{ "Black Apple", 'b' },
|
|
||||||
{ "L", 'L' },
|
|
||||||
{ "R", 'R' }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"INTV",
|
|
||||||
new Dictionary<string, char>
|
|
||||||
{
|
|
||||||
{ "Clear", 'C' },
|
|
||||||
{ "Enter", 'E' },
|
|
||||||
{ "Top", 'T' },
|
|
||||||
{ "NNE", 'n' },
|
|
||||||
{ "NE", '/' },
|
|
||||||
{ "ENE", 'e' },
|
|
||||||
{ "ESE", 'e' },
|
|
||||||
{ "SE", '\\' },
|
|
||||||
{ "SSE", 's' },
|
|
||||||
{ "SSW", 's' },
|
|
||||||
{ "SW", '/' },
|
|
||||||
{ "WSW", 'w' },
|
|
||||||
{ "WNW", 'w' },
|
|
||||||
{ "NW", '\\' },
|
|
||||||
{ "NNW", 'n' }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Coleco",
|
|
||||||
new Dictionary<string, char>
|
|
||||||
{
|
|
||||||
{ "Yellow", 'Y' },
|
|
||||||
{ "Red", 'R' },
|
|
||||||
{ "Blue", 'B' },
|
|
||||||
{ "Purple", 'P' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace BizHawk.Client.Common
|
||||||
void CopyTo(int index, string[] array, int arrayIndex, int count);
|
void CopyTo(int index, string[] array, int arrayIndex, int count);
|
||||||
}
|
}
|
||||||
|
|
||||||
class ListStringLog : List<string>, IStringLog
|
internal class ListStringLog : List<string>, IStringLog
|
||||||
{
|
{
|
||||||
public IStringLog Clone()
|
public IStringLog Clone()
|
||||||
{
|
{
|
||||||
|
@ -60,7 +60,7 @@ namespace BizHawk.Client.Common
|
||||||
/// It should be faster than those alternatives, but wasteful of disk space.
|
/// It should be faster than those alternatives, but wasteful of disk space.
|
||||||
/// It should also be easier to add new IList<string>-like methods than dealing with a database
|
/// It should also be easier to add new IList<string>-like methods than dealing with a database
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class StreamStringLog : IStringLog
|
internal class StreamStringLog : IStringLog
|
||||||
{
|
{
|
||||||
List<long> Offsets = new List<long>();
|
List<long> Offsets = new List<long>();
|
||||||
long cursor = 0;
|
long cursor = 0;
|
||||||
|
@ -165,7 +165,7 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Enumerator : IEnumerator<string>
|
private class Enumerator : IEnumerator<string>
|
||||||
{
|
{
|
||||||
public StreamStringLog log;
|
public StreamStringLog log;
|
||||||
int index = -1;
|
int index = -1;
|
||||||
|
|
Loading…
Reference in New Issue