Fixed NES mnemonic to match fm2. Fm2 files will now successfully playback. SMB TASes sync on bizhawk

This commit is contained in:
andres.delikat 2011-05-08 20:55:37 +00:00
parent 1c4fd5456e
commit 40379f898d
4 changed files with 28 additions and 75 deletions

View File

@ -314,62 +314,6 @@ namespace BizHawk.Emulation.Consoles.Nintendo
return null;
}
/* public void SetControllersAsMnemonic(string mnemonic)
{
if (mnemonic.Length == 0) return;
if (mnemonic[1] != '.')
Controller.ForceButton("Up");
if (mnemonic[2] != '.')
Controller.ForceButton("Down");
if (mnemonic[3] != '.')
Controller.ForceButton("Left");
if (mnemonic[4] != '.')
Controller.ForceButton("Right");
if (mnemonic[5] != '.')
Controller.ForceButton("B");
if (mnemonic[6] != '.')
Controller.ForceButton("A");
if (mnemonic[7] != '.')
Controller.ForceButton("Select");
if (mnemonic[8] != '.')
Controller.ForceButton("Start");
if (mnemonic[10] != '.' && mnemonic[10] != '0')
Controller.ForceButton("Reset");
}
public string GetControllersAsMnemonic()
{
string input = "|";
if (Controller.IsPressed("Up")) input += "U";
else input += ".";
if (Controller.IsPressed("Down")) input += "D";
else input += ".";
if (Controller.IsPressed("Left")) input += "L";
else input += ".";
if (Controller.IsPressed("Right")) input += "R";
else input += ".";
if (Controller.IsPressed("A")) input += "A";
else input += ".";
if (Controller.IsPressed("B")) input += "B";
else input += ".";
if (Controller.IsPressed("Select")) input += "s";
else input += ".";
if (Controller.IsPressed("Start")) input += "S";
else input += ".";
input += "|";
if (Controller.IsPressed("Reset")) input += "R";
else input += ".";
input += "|";
return input;
}*/
public string GameName { get { return game_name; } }
public enum EDetectionOrigin

View File

@ -29,8 +29,8 @@ namespace BizHawk
public ControllerDefinition ControllerDefinition { get { return NullController; } }
public IController Controller { get; set; }
public string GetControllersAsMnemonic() { return "|.|.|"; }
public void SetControllersAsMnemonic(string mnemonic) { return; }
//public string GetControllersAsMnemonic() { return "|.|.|"; }
//public void SetControllersAsMnemonic(string mnemonic) { return; }
public int Frame { get; set; }
public int LagCount { get { return 0; } set { return; } }

View File

@ -218,16 +218,17 @@ namespace BizHawk.MultiClient
if (type.Name == "NES Controls")
{
input.Append(IsPressed("Reset") ? "r" : ".");
input.Append("|");
input.Append(IsPressed("A") ? "A" : ".");
input.Append(IsPressed("B") ? "B" : ".");
input.Append(IsPressed("Select") ? "s" : ".");
input.Append(IsPressed("Start") ? "S" : ".");
input.Append(IsPressed("Up") ? "U" : ".");
input.Append(IsPressed("Down") ? "D" : ".");
input.Append(IsPressed("Left") ? "L" : ".");
input.Append(IsPressed("Right") ? "R" : ".");
input.Append(IsPressed("A") ? "A" : ".");
input.Append(IsPressed("B") ? "B" : ".");
input.Append(IsPressed("Select") ? "s" : ".");
input.Append(IsPressed("Start") ? "S" : ".");
input.Append("|");
input.Append(IsPressed("Reset") ? "R" : ".");
return input.ToString();
}
@ -309,15 +310,23 @@ namespace BizHawk.MultiClient
if (type.Name == "NES Controls")
{
if (mnemonic[1] != '.') programmaticallyPressedButtons.Add("Up");
if (mnemonic[2] != '.') programmaticallyPressedButtons.Add("Down");
if (mnemonic[3] != '.') programmaticallyPressedButtons.Add("Left");
if (mnemonic[4] != '.') programmaticallyPressedButtons.Add("Right");
if (mnemonic[5] != '.') programmaticallyPressedButtons.Add("A");
if (mnemonic[6] != '.') programmaticallyPressedButtons.Add("B");
if (mnemonic[7] != '.') programmaticallyPressedButtons.Add("Select");
if (mnemonic[8] != '.') programmaticallyPressedButtons.Add("Start");
if (mnemonic[10] != '.') programmaticallyPressedButtons.Add("Reset");
//if (mnemonic[1] != '.') programmaticallyPressedButtons.Add("Reset");
if (mnemonic[3] != '.') programmaticallyPressedButtons.Add("Right");
if (mnemonic[4] != '.') programmaticallyPressedButtons.Add("Left");
if (mnemonic[5] != '.') programmaticallyPressedButtons.Add("Down");
if (mnemonic[6] != '.') programmaticallyPressedButtons.Add("Up");
if (mnemonic[7] != '.') programmaticallyPressedButtons.Add("Start");
if (mnemonic[8] != '.') programmaticallyPressedButtons.Add("Select");
if (mnemonic[9] != '.') programmaticallyPressedButtons.Add("B");
if (mnemonic[10] != '.') programmaticallyPressedButtons.Add("A");
}
}
}

View File

@ -65,7 +65,7 @@ namespace BizHawk.MultiClient
using (HawkFile NesCartFile = new HawkFile("NesCarts.7z").BindFirst())
return Util.ReadAllBytes(NesCartFile.GetStream());
};
//InputLog.StartPlayback(); //Debug switch this on to play back log.tas
Global.MainForm = this;
Database.LoadDatabase("gamedb.txt");
@ -640,13 +640,13 @@ namespace BizHawk.MultiClient
if (InputLog.GetMovieMode() == MOVIEMODE.RECORD)
InputLog.StartNewRecording(); //TODO: Uncomment and check for a user movie selected?
/*
else if (InputLog.GetMovieMode() == MOVIEMODE.PLAY)
{
InputLog.LoadMovie(); //TODO: Debug
InputLog.StartPlayback(); //TODO: Debug
}
*/
//setup the throttle based on platform's specifications
//(one day later for some systems we will need to modify it at runtime as the display mode changes)
{