-Refactored NES and PCE button orders.

-Realized that FixMnemonic is useless as GetControllersAsMnemonic() + WriteMovie() = Fixed.
-Finished the NES / PCE importers, now without string builders (Thanks zeromus)!
-Converted ImportMMV to this same method.

TODO:
-Decide how's the best way to handle the mnemonic header and implement it. Apparently, anything other than a predefined header and a | is considered as a comment, so I might do something like:

comment Mnemonic format:
[0|UDLRsSBA]
This commit is contained in:
brandman211 2012-02-19 07:08:55 +00:00
parent 7ea52dfc8d
commit 5534bbd8b5
1 changed files with 9 additions and 8 deletions

View File

@ -164,13 +164,15 @@ namespace BizHawk.MultiClient
bool IsBasePressed(string name)
{
bool ret = Source.IsPressed(name);
if (ret)
{
//int zzz=9;
}
return ret;
}
public string GetControllersAsMnemonic()
{
bool hasGlobalEmulator = Global.Emulator != null;
StringBuilder input = new StringBuilder("|");
if (ControlType == "Genesis 3-Button Controller")
@ -220,11 +222,10 @@ namespace BizHawk.MultiClient
input.Append(IsBasePressed("P" + player.ToString() + " Left") ? "L" : ".");
input.Append(IsBasePressed("P" + player.ToString() + " Right") ? "R" : ".");
input.Append(IsBasePressed("P" + player.ToString() + " Select") ? "S" : ".");
input.Append(IsBasePressed("P" + player.ToString() + " Run") ? "R" : ".");
input.Append(IsBasePressed("P" + player.ToString() + " Run") ? "r" : ".");
input.Append(IsBasePressed("P" + player.ToString() + " B2") ? "2" : ".");
input.Append(IsBasePressed("P" + player.ToString() + " B1") ? "1" : ".");
input.Append("|");
}
return input.ToString();
}
@ -245,10 +246,10 @@ namespace BizHawk.MultiClient
return input.ToString();
}
if (ControlType == "NES Controls")
if (ControlType == "NES Controller")
{
input.Append(IsBasePressed("Reset") ? "r" :
(hasGlobalEmulator && Global.Emulator.IsLagFrame) ? "L" : ".");
input.Append(IsBasePressed("Reset") ? "r" :
Global.Emulator.IsLagFrame ? "L" : ".");
input.Append("|");
for (int player = 1; player <= 4; player++)
{
@ -545,7 +546,7 @@ namespace BizHawk.MultiClient
}
}
if (ControlType == "NES Controls")
if (ControlType == "NES Controller")
{
if (mnemonic.Length < 2) return;
Force("Reset", mnemonic[1] != '.' && mnemonic[1] != '0' && mnemonic[1] != 'L');