-Fixed reset stuff.

--Zanac syncs.
--Applied error messages for invalid flags.
This commit is contained in:
brandman211 2012-02-19 20:09:42 +00:00
parent 791f9624f5
commit cc4b2c324c
1 changed files with 37 additions and 0 deletions

View File

@ -98,10 +98,13 @@ namespace BizHawk.MultiClient
var file = new FileInfo(path);
using (StreamReader sr = file.OpenText())
{
int line = 0;
string str = "";
string rerecordStr = "";
string warning = "";
while ((str = sr.ReadLine()) != null)
{
line++;
if (str == "")
{
continue;
@ -172,6 +175,36 @@ namespace BizHawk.MultiClient
SimpleController controllers = new SimpleController();
controllers.Type = new ControllerDefinition();
controllers.Type.Name = console + " Controller";
if (warning == "" && sections[1].Length != 0 && emulator == "FCEUX")
{
switch (sections[1][0])
{
case '0':
break;
case '1':
controllers["Reset"] = true;
break;
case '2':
if (m.Length() != 0)
{
warning = "hard reset";
}
break;
case '4':
warning = "FDS Insert";
break;
case '8':
warning = "FDS Select";
break;
default:
warning = "unknown";
break;
}
if (warning != "")
{
warning = "Unable to import " + warning + " command on line " + line;
}
}
for (int player = 2; player < sections.Length; player++)
{
if (sections[player].Length == buttons.Length)
@ -193,6 +226,10 @@ namespace BizHawk.MultiClient
m.Header.Comments.Add(str);
}
}
if (warning != "")
{
Global.RenderPanel.AddMessage(warning);
}
}
return m;
}