Some movie code reorg and remove some outdated stuff

This commit is contained in:
adelikat 2014-06-15 01:55:35 +00:00
parent 6ec1a45b70
commit f5f832180d
5 changed files with 87 additions and 283 deletions

View File

@ -141,6 +141,8 @@
<Compile Include="movie\bk2\Bk2Movie.ModeApi.cs" />
<Compile Include="movie\bkm\BkmHeader.cs" />
<Compile Include="movie\bkm\BkmLog.cs" />
<Compile Include="movie\bkm\BkmLogEntryGenerator.cs" />
<Compile Include="movie\bkm\BkmMnemonicConstants.cs" />
<Compile Include="movie\bkm\BkmMovie.cs" />
<Compile Include="movie\bkm\BkmMovie.HeaderApi.cs" />
<Compile Include="movie\bkm\BkmMovie.InputLog.cs" />
@ -150,13 +152,10 @@
<Compile Include="movie\InputAdapters.cs" />
<Compile Include="movie\interfaces\ILogEntryGenerator.cs" />
<Compile Include="movie\interfaces\IMovie.cs" />
<Compile Include="movie\MnemonicsGenerator.cs" />
<Compile Include="movie\MovieImport.cs" />
<Compile Include="movie\MovieMnemonics.cs" />
<Compile Include="movie\MovieService.cs" />
<Compile Include="movie\MovieSession.cs" />
<Compile Include="movie\MultitrackRecording.cs" />
<Compile Include="movie\MnemonicsLookupTable.cs" />
<Compile Include="movie\PlatformFrameRates.cs" />
<Compile Include="movie\Subtitle.cs" />
<Compile Include="movie\SubtitleList.cs" />

View File

@ -1,195 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BizHawk.Common;
namespace BizHawk.Client.Common
{
public class MnemonicCollection : NamedDictionary<string, char>
{
public MnemonicCollection(string name)
: base(name)
{
}
}
public class CoreMnemonicCollection : List<MnemonicCollection>
{
private readonly List<string> _systemIds;
public CoreMnemonicCollection(string systemId)
{
_systemIds = new List<string>
{
systemId
};
}
public CoreMnemonicCollection(string[] systemIds)
{
_systemIds = systemIds.ToList();
}
public MnemonicCollection this[string name]
{
get
{
return this.FirstOrDefault(x => x.Name == name);
}
}
public IEnumerable<string> SystemIds
{
get { return _systemIds; }
}
}
public class MnemonicLookupTable
{
private List<CoreMnemonicCollection> _list;
public CoreMnemonicCollection this[string systemId]
{
get
{
return _list.FirstOrDefault(core => core.SystemIds.Contains(systemId));
}
}
public MnemonicLookupTable()
{
_list = new List<CoreMnemonicCollection>
{
new CoreMnemonicCollection(new []{ "NES", "FDS" })
{
new MnemonicCollection("Console")
{
{ "Reset", 'r' },
{ "Power", 'P' },
{ "FDS Eject", 'E' },
{ "FDS Insert 0", '0' },
{ "FDS Insert 1", '1' },
{ "VS Coin 1", 'c' },
{ "VS Coin 2", 'C' }
},
new MnemonicCollection("Player 1")
{
{ "P1 Up", 'U' },
{ "P1 Down", 'D' },
{ "P1 Left", 'L' },
{ "P1 Right", 'R' },
{ "P1 Select", 's' },
{ "P1 Start", 'S' },
{ "P1 B", 'B' },
{ "P1 A", 'A' }
},
new MnemonicCollection("Player 2")
{
{ "P2 Up", 'U' },
{ "P2 Down", 'D' },
{ "P2 Left", 'L' },
{ "P2 Right", 'R' },
{ "P2 Select", 's' },
{ "P2 Start", 'S' },
{ "P2 B", 'B' },
{ "P2 A", 'A' }
},
new MnemonicCollection("Player 3")
{
{ "P3 Up", 'U' },
{ "P3 Down", 'D' },
{ "P3 Left", 'L' },
{ "P3 Right", 'R' },
{ "P3 Select", 's' },
{ "P3 Start", 'S' },
{ "P3 B", 'B' },
{ "P3 A", 'A' }
},
new MnemonicCollection("Player 4")
{
{ "P4 Up", 'U' },
{ "P4 Down", 'D' },
{ "P4 Left", 'L' },
{ "P4 Right", 'R' },
{ "P4 Select", 's' },
{ "P4 Start", 'S' },
{ "P4 B", 'B' },
{ "P4 A", 'A' }
}
},
new CoreMnemonicCollection(new []{ "SNES", "SGB" })
{
new MnemonicCollection("Console")
{
{ "Reset", 'r' },
{ "Power", 'P' },
},
new MnemonicCollection("Player 1")
{
{ "P1 Up", 'U' },
{ "P1 Down", 'D' },
{ "P1 Left", 'L' },
{ "P1 Right", 'R' },
{ "P1 Select", 's' },
{ "P1 Start", 'S' },
{ "P1 B", 'B' },
{ "P1 A", 'A' },
{ "P1 X", 'X' },
{ "P1 Y", 'Y'},
{ "P1 L", 'L'},
{ "P1 R", 'R'}
},
new MnemonicCollection("Player 2")
{
{ "P2 Up", 'U' },
{ "P2 Down", 'D' },
{ "P2 Left", 'L' },
{ "P2 Right", 'R' },
{ "P2 Select", 's' },
{ "P2 Start", 'S' },
{ "P2 B", 'B' },
{ "P2 A", 'A' },
{ "P2 X", 'X' },
{ "P2 Y", 'Y'},
{ "P2 L", 'L'},
{ "P2 R", 'R'}
},
new MnemonicCollection("Player 3")
{
{ "P3 Up", 'U' },
{ "P3 Down", 'D' },
{ "P3 Left", 'L' },
{ "P3 Right", 'R' },
{ "P3 Select", 's' },
{ "P3 Start", 'S' },
{ "P3 B", 'B' },
{ "P3 A", 'A' },
{ "P3 X", 'X' },
{ "P3 Y", 'Y'},
{ "P3 L", 'L'},
{ "P3 R", 'R'}
},
new MnemonicCollection("Player 4")
{
{ "P4 Up", 'U' },
{ "P4 Down", 'D' },
{ "P4 Left", 'L' },
{ "P4 Right", 'R' },
{ "P4 Select", 's' },
{ "P4 Start", 'S' },
{ "P4 B", 'B' },
{ "P4 A", 'A' },
{ "P4 X", 'X' },
{ "P4 Y", 'Y'},
{ "P4 L", 'L'},
{ "P4 R", 'R'}
}
}
};
}
}
}

View File

@ -274,7 +274,7 @@ namespace BizHawk.Client.Common
// Only count lines with that have the right number of buttons and are for valid players.
if (
sections[section].Length == buttons.Length &&
player <= MnemonicConstants.PLAYERS[controllers.Type.Name]
player <= BkmMnemonicConstants.PLAYERS[controllers.Type.Name]
)
{
for (int button = 0; button < buttons.Length; button++)
@ -1971,7 +1971,7 @@ namespace BizHawk.Client.Common
}
}
ushort controllerState = (ushort)(((controllerState1 << 4) & 0x0F00) | controllerState2);
if (player <= MnemonicConstants.PLAYERS[controllers.Type.Name])
if (player <= BkmMnemonicConstants.PLAYERS[controllers.Type.Name])
{
for (int button = 0; button < buttons.Length; button++)
{
@ -2759,7 +2759,7 @@ namespace BizHawk.Client.Common
}
}
leftOver = !leftOver;
if (player <= MnemonicConstants.PLAYERS[controllers.Type.Name])
if (player <= BkmMnemonicConstants.PLAYERS[controllers.Type.Name])
{
if (player != 2 || !superScope)
{

View File

@ -77,15 +77,15 @@ namespace BizHawk.Client.Common
{
if (IsBasePressed("Power"))
{
input.Append(MnemonicConstants.COMMANDS[_controlType]["Power"]);
input.Append(BkmMnemonicConstants.COMMANDS[_controlType]["Power"]);
}
else if (IsBasePressed("Reset"))
{
input.Append(MnemonicConstants.COMMANDS[_controlType]["Reset"]);
input.Append(BkmMnemonicConstants.COMMANDS[_controlType]["Reset"]);
}
else if (IsBasePressed("FDS Eject"))
{
input.Append(MnemonicConstants.COMMANDS[_controlType]["FDS Eject"]);
input.Append(BkmMnemonicConstants.COMMANDS[_controlType]["FDS Eject"]);
}
else if (IsBasePressed("FDS Insert 0"))
{
@ -105,11 +105,11 @@ namespace BizHawk.Client.Common
}
else if (IsBasePressed("VS Coin 1"))
{
input.Append(MnemonicConstants.COMMANDS[_controlType]["VS Coin 1"]);
input.Append(BkmMnemonicConstants.COMMANDS[_controlType]["VS Coin 1"]);
}
else if (IsBasePressed("VS Coin 2"))
{
input.Append(MnemonicConstants.COMMANDS[_controlType]["VS Coin 2"]);
input.Append(BkmMnemonicConstants.COMMANDS[_controlType]["VS Coin 2"]);
}
else
{
@ -120,11 +120,11 @@ namespace BizHawk.Client.Common
{
if (IsBasePressed("Power"))
{
input.Append(MnemonicConstants.COMMANDS[_controlType]["Power"]);
input.Append(BkmMnemonicConstants.COMMANDS[_controlType]["Power"]);
}
else if (IsBasePressed("Reset"))
{
input.Append(MnemonicConstants.COMMANDS[_controlType]["Reset"]);
input.Append(BkmMnemonicConstants.COMMANDS[_controlType]["Reset"]);
}
else
{
@ -133,7 +133,7 @@ namespace BizHawk.Client.Common
}
else if (_controlType == "Gameboy Controller")
{
input.Append(IsBasePressed("Power") ? MnemonicConstants.COMMANDS[_controlType]["Power"] : ".");
input.Append(IsBasePressed("Power") ? BkmMnemonicConstants.COMMANDS[_controlType]["Power"] : ".");
}
if (_controlType != "SMS Controller" && _controlType != "TI83 Controller" && _controlType != "ColecoVision Basic Controller")
@ -141,7 +141,7 @@ namespace BizHawk.Client.Common
input.Append("|");
}
for (int player = 1; player <= MnemonicConstants.PLAYERS[_controlType]; player++)
for (int player = 1; player <= BkmMnemonicConstants.PLAYERS[_controlType]; player++)
{
var prefix = String.Empty;
if (_controlType != "Gameboy Controller" && _controlType != "TI83 Controller")
@ -149,9 +149,9 @@ namespace BizHawk.Client.Common
prefix = "P" + player + " ";
}
foreach (var button in MnemonicConstants.BUTTONS[_controlType].Keys)
foreach (var button in BkmMnemonicConstants.BUTTONS[_controlType].Keys)
{
input.Append(IsBasePressed(prefix + button) ? MnemonicConstants.BUTTONS[_controlType][button] : ".");
input.Append(IsBasePressed(prefix + button) ? BkmMnemonicConstants.BUTTONS[_controlType][button] : ".");
}
input.Append("|");
@ -159,9 +159,9 @@ namespace BizHawk.Client.Common
if (_controlType == "SMS Controller")
{
foreach (var command in MnemonicConstants.COMMANDS[_controlType].Keys)
foreach (var command in BkmMnemonicConstants.COMMANDS[_controlType].Keys)
{
input.Append(IsBasePressed(command) ? MnemonicConstants.COMMANDS[_controlType][command] : ".");
input.Append(IsBasePressed(command) ? BkmMnemonicConstants.COMMANDS[_controlType][command] : ".");
}
input.Append("|");
@ -259,7 +259,7 @@ namespace BizHawk.Client.Common
var input = new StringBuilder("|");
if (IsBasePressed("Power"))
{
input.Append(MnemonicConstants.COMMANDS[_controlType]["Power"]);
input.Append(BkmMnemonicConstants.COMMANDS[_controlType]["Power"]);
}
else
{
@ -267,9 +267,9 @@ namespace BizHawk.Client.Common
}
input.Append("|");
foreach (var button in MnemonicConstants.BUTTONS[_controlType].Keys)
foreach (var button in BkmMnemonicConstants.BUTTONS[_controlType].Keys)
{
input.Append(IsBasePressed(button) ? MnemonicConstants.BUTTONS[_controlType][button] : ".");
input.Append(IsBasePressed(button) ? BkmMnemonicConstants.BUTTONS[_controlType][button] : ".");
}
input.Append("|");
@ -282,11 +282,11 @@ namespace BizHawk.Client.Common
if (IsBasePressed("Power"))
{
input.Append(MnemonicConstants.COMMANDS[_controlType]["Power"]);
input.Append(BkmMnemonicConstants.COMMANDS[_controlType]["Power"]);
}
else if (IsBasePressed("Reset"))
{
input.Append(MnemonicConstants.COMMANDS[_controlType]["Reset"]);
input.Append(BkmMnemonicConstants.COMMANDS[_controlType]["Reset"]);
}
else
{
@ -294,11 +294,11 @@ namespace BizHawk.Client.Common
}
input.Append("|");
for (int player = 1; player <= MnemonicConstants.PLAYERS[_controlType]; player++)
for (int player = 1; player <= BkmMnemonicConstants.PLAYERS[_controlType]; player++)
{
foreach (var button in MnemonicConstants.BUTTONS[_controlType].Keys)
foreach (var button in BkmMnemonicConstants.BUTTONS[_controlType].Keys)
{
input.Append(IsBasePressed("P" + player + " " + button) ? MnemonicConstants.BUTTONS[_controlType][button] : ".");
input.Append(IsBasePressed("P" + player + " " + button) ? BkmMnemonicConstants.BUTTONS[_controlType][button] : ".");
}
input.Append("|");
@ -311,19 +311,19 @@ namespace BizHawk.Client.Common
{
var input = new StringBuilder("|");
for (int player = 1; player <= MnemonicConstants.PLAYERS[_controlType]; player++)
for (int player = 1; player <= BkmMnemonicConstants.PLAYERS[_controlType]; player++)
{
foreach (var button in MnemonicConstants.BUTTONS[_controlType].Keys)
foreach (var button in BkmMnemonicConstants.BUTTONS[_controlType].Keys)
{
input.Append(IsBasePressed("P" + player + " " + button) ? MnemonicConstants.BUTTONS[_controlType][button] : ".");
input.Append(IsBasePressed("P" + player + " " + button) ? BkmMnemonicConstants.BUTTONS[_controlType][button] : ".");
}
input.Append('|');
}
foreach (var button in MnemonicConstants.BUTTONS["Commodore 64 Keyboard"].Keys)
foreach (var button in BkmMnemonicConstants.BUTTONS["Commodore 64 Keyboard"].Keys)
{
input.Append(IsBasePressed(button) ? MnemonicConstants.BUTTONS["Commodore 64 Keyboard"][button] : ".");
input.Append(IsBasePressed(button) ? BkmMnemonicConstants.BUTTONS["Commodore 64 Keyboard"][button] : ".");
}
input.Append('|');
@ -335,7 +335,7 @@ namespace BizHawk.Client.Common
// |.|........|.|........|
var input = new StringBuilder();
foreach (var t in MnemonicConstants.DGBMnemonic)
foreach (var t in BkmMnemonicConstants.DGBMnemonic)
{
if (t.Item1 != null)
{
@ -355,7 +355,7 @@ namespace BizHawk.Client.Common
// |....|....|...|
var input = new StringBuilder();
foreach (var t in MnemonicConstants.WSMnemonic)
foreach (var t in BkmMnemonicConstants.WSMnemonic)
{
if (t.Item1 != null)
{
@ -379,11 +379,11 @@ namespace BizHawk.Client.Common
input.Append(IsBasePressed("Pause") ? 'p' : '.');
input.Append('|');
for (int player = 1; player <= MnemonicConstants.PLAYERS[_controlType]; player++)
for (int player = 1; player <= BkmMnemonicConstants.PLAYERS[_controlType]; player++)
{
foreach (var button in MnemonicConstants.BUTTONS[_controlType].Keys)
foreach (var button in BkmMnemonicConstants.BUTTONS[_controlType].Keys)
{
input.Append(IsBasePressed("P" + player + " " + button) ? MnemonicConstants.BUTTONS[_controlType][button] : ".");
input.Append(IsBasePressed("P" + player + " " + button) ? BkmMnemonicConstants.BUTTONS[_controlType][button] : ".");
}
input.Append('|');
@ -410,16 +410,16 @@ namespace BizHawk.Client.Common
input.Append('|');
for (int player = 1; player <= MnemonicConstants.PLAYERS[_controlType]; player++)
for (int player = 1; player <= BkmMnemonicConstants.PLAYERS[_controlType]; player++)
{
foreach (var button in MnemonicConstants.BUTTONS[_controlType].Keys)
foreach (var button in BkmMnemonicConstants.BUTTONS[_controlType].Keys)
{
input.Append(IsBasePressed("P" + player + " " + button) ? MnemonicConstants.BUTTONS[_controlType][button] : ".");
input.Append(IsBasePressed("P" + player + " " + button) ? BkmMnemonicConstants.BUTTONS[_controlType][button] : ".");
}
if (MnemonicConstants.ANALOGS[_controlType].Keys.Count > 0)
if (BkmMnemonicConstants.ANALOGS[_controlType].Keys.Count > 0)
{
foreach (var name in MnemonicConstants.ANALOGS[_controlType].Keys)
foreach (var name in BkmMnemonicConstants.ANALOGS[_controlType].Keys)
{
int val;
@ -494,11 +494,11 @@ namespace BizHawk.Client.Common
input.Append('|');
for (int player = 1; player <= MnemonicConstants.PLAYERS[_controlType]; player++)
for (int player = 1; player <= BkmMnemonicConstants.PLAYERS[_controlType]; player++)
{
foreach (var button in MnemonicConstants.BUTTONS[_controlType].Keys)
foreach (var button in BkmMnemonicConstants.BUTTONS[_controlType].Keys)
{
input.Append(IsBasePressed("P" + player + " " + button) ? MnemonicConstants.BUTTONS[_controlType][button] : ".");
input.Append(IsBasePressed("P" + player + " " + button) ? BkmMnemonicConstants.BUTTONS[_controlType][button] : ".");
}
input.Append('|');
@ -513,11 +513,11 @@ namespace BizHawk.Client.Common
if (IsBasePressed("Power"))
{
input.Append(MnemonicConstants.COMMANDS[_controlType]["Power"]);
input.Append(BkmMnemonicConstants.COMMANDS[_controlType]["Power"]);
}
else if (IsBasePressed("Reset"))
{
input.Append(MnemonicConstants.COMMANDS[_controlType]["Reset"]);
input.Append(BkmMnemonicConstants.COMMANDS[_controlType]["Reset"]);
}
else
{
@ -525,11 +525,11 @@ namespace BizHawk.Client.Common
}
input.Append("|");
for (int player = 1; player <= MnemonicConstants.PLAYERS[_controlType]; player++)
for (int player = 1; player <= BkmMnemonicConstants.PLAYERS[_controlType]; player++)
{
foreach (var button in MnemonicConstants.BUTTONS[_controlType].Keys)
foreach (var button in BkmMnemonicConstants.BUTTONS[_controlType].Keys)
{
input.Append(IsBasePressed("P" + player + " " + button) ? MnemonicConstants.BUTTONS[_controlType][button] : ".");
input.Append(IsBasePressed("P" + player + " " + button) ? BkmMnemonicConstants.BUTTONS[_controlType][button] : ".");
}
input.Append("|");

View File

@ -9,7 +9,7 @@ using BizHawk.Emulation.Common;
namespace BizHawk.Client.Common
{
public static class MnemonicConstants
public static class BkmMnemonicConstants
{
public static readonly Dictionary<string, Dictionary<string, string>> BUTTONS = new Dictionary<string, Dictionary<string, string>>
{
@ -330,7 +330,7 @@ namespace BizHawk.Client.Common
Force("Power", true);
}
int start = 3;
foreach (string button in MnemonicConstants.BUTTONS[ControlType].Keys)
foreach (string button in BkmMnemonicConstants.BUTTONS[ControlType].Keys)
{
Force(button, c[start++]);
}
@ -360,17 +360,17 @@ namespace BizHawk.Client.Common
return;
}
for (int player = 1; player <= MnemonicConstants.PLAYERS[ControlType]; player++)
for (int player = 1; player <= BkmMnemonicConstants.PLAYERS[ControlType]; player++)
{
int srcindex = (player - 1) * (MnemonicConstants.BUTTONS[ControlType].Count + 1);
int srcindex = (player - 1) * (BkmMnemonicConstants.BUTTONS[ControlType].Count + 1);
if (mnemonic.Length < srcindex + 3 + MnemonicConstants.BUTTONS[ControlType].Count - 1)
if (mnemonic.Length < srcindex + 3 + BkmMnemonicConstants.BUTTONS[ControlType].Count - 1)
{
return;
}
int start = 3;
foreach (string button in MnemonicConstants.BUTTONS[ControlType].Keys)
foreach (string button in BkmMnemonicConstants.BUTTONS[ControlType].Keys)
{
Force("P" + player + " " + button, c[srcindex + start++]);
}
@ -396,17 +396,17 @@ namespace BizHawk.Client.Common
Force("Reset", true);
}
for (int player = 1; player <= MnemonicConstants.PLAYERS[ControlType]; player++)
for (int player = 1; player <= BkmMnemonicConstants.PLAYERS[ControlType]; player++)
{
int srcindex = (player - 1) * (MnemonicConstants.BUTTONS[ControlType].Count + 1);
int srcindex = (player - 1) * (BkmMnemonicConstants.BUTTONS[ControlType].Count + 1);
if (mnemonic.Length < srcindex + 3 + MnemonicConstants.BUTTONS[ControlType].Count - 1)
if (mnemonic.Length < srcindex + 3 + BkmMnemonicConstants.BUTTONS[ControlType].Count - 1)
{
return;
}
int start = 3;
foreach (string button in MnemonicConstants.BUTTONS[ControlType].Keys)
foreach (string button in BkmMnemonicConstants.BUTTONS[ControlType].Keys)
{
Force("P" + player + " " + button, c[srcindex + start++]);
}
@ -432,22 +432,22 @@ namespace BizHawk.Client.Common
Force("Reset", true);
}
for (int player = 1; player <= MnemonicConstants.PLAYERS[ControlType]; player++)
for (int player = 1; player <= BkmMnemonicConstants.PLAYERS[ControlType]; player++)
{
int srcindex = (player - 1) * (MnemonicConstants.BUTTONS[ControlType].Count + MnemonicConstants.ANALOGS[ControlType].Count * 4 + 1 + 1);
int srcindex = (player - 1) * (BkmMnemonicConstants.BUTTONS[ControlType].Count + BkmMnemonicConstants.ANALOGS[ControlType].Count * 4 + 1 + 1);
if (mnemonic.Length < srcindex + 3 + MnemonicConstants.BUTTONS[ControlType].Count - 1)
if (mnemonic.Length < srcindex + 3 + BkmMnemonicConstants.BUTTONS[ControlType].Count - 1)
{
return;
}
int start = 3;
foreach (string button in MnemonicConstants.BUTTONS[ControlType].Keys)
foreach (string button in BkmMnemonicConstants.BUTTONS[ControlType].Keys)
{
Force("P" + player + " " + button, c[srcindex + start++]);
}
foreach (string name in MnemonicConstants.ANALOGS[ControlType].Keys)
foreach (string name in BkmMnemonicConstants.ANALOGS[ControlType].Keys)
{
Force("P" + player + " " + name, Int32.Parse(mnemonic.Substring(srcindex + start, 4)));
start += 5;
@ -474,17 +474,17 @@ namespace BizHawk.Client.Common
Force("Reset", true);
}
for (int player = 1; player <= MnemonicConstants.PLAYERS[ControlType]; player++)
for (int player = 1; player <= BkmMnemonicConstants.PLAYERS[ControlType]; player++)
{
int srcindex = (player - 1) * (MnemonicConstants.BUTTONS[ControlType].Count + 1);
int srcindex = (player - 1) * (BkmMnemonicConstants.BUTTONS[ControlType].Count + 1);
if (mnemonic.Length < srcindex + 3 + MnemonicConstants.BUTTONS[ControlType].Count - 1)
if (mnemonic.Length < srcindex + 3 + BkmMnemonicConstants.BUTTONS[ControlType].Count - 1)
{
return;
}
int start = 3;
foreach (string button in MnemonicConstants.BUTTONS[ControlType].Keys)
foreach (string button in BkmMnemonicConstants.BUTTONS[ControlType].Keys)
{
Force("P" + player + " " + button, c[srcindex + start++]);
}
@ -517,16 +517,16 @@ namespace BizHawk.Client.Common
Force("Pause", true);
}
for (int player = 1; player <= MnemonicConstants.PLAYERS[ControlType]; player++)
for (int player = 1; player <= BkmMnemonicConstants.PLAYERS[ControlType]; player++)
{
int srcindex = (player - 1) * (MnemonicConstants.BUTTONS[ControlType].Count + 1);
int srcindex = (player - 1) * (BkmMnemonicConstants.BUTTONS[ControlType].Count + 1);
int start = 6;
if (mnemonic.Length < srcindex + start + MnemonicConstants.BUTTONS[ControlType].Count)
if (mnemonic.Length < srcindex + start + BkmMnemonicConstants.BUTTONS[ControlType].Count)
{
return;
}
foreach (string button in MnemonicConstants.BUTTONS[ControlType].Keys)
foreach (string button in BkmMnemonicConstants.BUTTONS[ControlType].Keys)
{
Force("P" + player + " " + button, c[srcindex + start++]);
}
@ -537,9 +537,9 @@ namespace BizHawk.Client.Common
{
var checker = new MnemonicChecker(mnemonic);
MyBoolButtons.Clear();
for (int i = 0; i < MnemonicConstants.DGBMnemonic.Length; i++)
for (int i = 0; i < BkmMnemonicConstants.DGBMnemonic.Length; i++)
{
var t = MnemonicConstants.DGBMnemonic[i];
var t = BkmMnemonicConstants.DGBMnemonic[i];
if (t.Item1 != null)
{
Force(t.Item1, checker[i]);
@ -551,9 +551,9 @@ namespace BizHawk.Client.Common
{
var checker = new MnemonicChecker(mnemonic);
MyBoolButtons.Clear();
for (int i = 0; i < MnemonicConstants.WSMnemonic.Length; i++)
for (int i = 0; i < BkmMnemonicConstants.WSMnemonic.Length; i++)
{
var t = MnemonicConstants.WSMnemonic[i];
var t = BkmMnemonicConstants.WSMnemonic[i];
if (t.Item1 != null)
{
Force(t.Item1, checker[i]);
@ -567,24 +567,24 @@ namespace BizHawk.Client.Common
MyBoolButtons.Clear();
for (int player = 1; player <= MnemonicConstants.PLAYERS[ControlType]; player++)
for (int player = 1; player <= BkmMnemonicConstants.PLAYERS[ControlType]; player++)
{
int srcindex = (player - 1) * (MnemonicConstants.BUTTONS[ControlType].Count + 1);
int srcindex = (player - 1) * (BkmMnemonicConstants.BUTTONS[ControlType].Count + 1);
if (mnemonic.Length < srcindex + 1 + MnemonicConstants.BUTTONS[ControlType].Count - 1)
if (mnemonic.Length < srcindex + 1 + BkmMnemonicConstants.BUTTONS[ControlType].Count - 1)
{
return;
}
int start = 1;
foreach (string button in MnemonicConstants.BUTTONS[ControlType].Keys)
foreach (string button in BkmMnemonicConstants.BUTTONS[ControlType].Keys)
{
Force("P" + player + " " + button, c[srcindex + start++]);
}
}
int startk = 13;
foreach (string button in MnemonicConstants.BUTTONS["Commodore 64 Keyboard"].Keys)
foreach (string button in BkmMnemonicConstants.BUTTONS["Commodore 64 Keyboard"].Keys)
{
Force(button, c[startk++]);
}
@ -719,11 +719,11 @@ namespace BizHawk.Client.Common
Force("Select", mnemonic[2] != '.' && mnemonic[2] != '0');
start = 4;
}
for (int player = 1; player <= MnemonicConstants.PLAYERS[ControlType]; player++)
for (int player = 1; player <= BkmMnemonicConstants.PLAYERS[ControlType]; player++)
{
int srcindex = (player - 1) * (MnemonicConstants.BUTTONS[ControlType].Count + 1);
int srcindex = (player - 1) * (BkmMnemonicConstants.BUTTONS[ControlType].Count + 1);
int ctr = start;
if (mnemonic.Length < srcindex + ctr + MnemonicConstants.BUTTONS[ControlType].Count - 1)
if (mnemonic.Length < srcindex + ctr + BkmMnemonicConstants.BUTTONS[ControlType].Count - 1)
{
return;
}
@ -732,16 +732,16 @@ namespace BizHawk.Client.Common
{
prefix = "P" + player + " ";
}
foreach (string button in MnemonicConstants.BUTTONS[ControlType].Keys)
foreach (string button in BkmMnemonicConstants.BUTTONS[ControlType].Keys)
{
Force(prefix + button, c[srcindex + ctr++]);
}
}
if (ControlType == "SMS Controller")
{
int srcindex = MnemonicConstants.PLAYERS[ControlType] * (MnemonicConstants.BUTTONS[ControlType].Count + 1);
int srcindex = BkmMnemonicConstants.PLAYERS[ControlType] * (BkmMnemonicConstants.BUTTONS[ControlType].Count + 1);
int ctr = start;
foreach (string command in MnemonicConstants.COMMANDS[ControlType].Keys)
foreach (string command in BkmMnemonicConstants.COMMANDS[ControlType].Keys)
{
Force(command, c[srcindex + ctr++]);
}