-Fixed the value to & with the update to determine the difference between a Control and Controller.
-Set the buttons to the opposite state when they are updated. --Presumably, this is how this works. -Read the delta bytes. TODO: Figure out where in the world the writing of frames actually comes into play.
This commit is contained in:
parent
e5fb7a6958
commit
b07fa3b7c2
|
@ -369,9 +369,7 @@ namespace BizHawk.MultiClient
|
||||||
// 034 name of the ROM used - UTF8 encoded nul-terminated string.
|
// 034 name of the ROM used - UTF8 encoded nul-terminated string.
|
||||||
List<byte> gameBytes = new List<byte>();
|
List<byte> gameBytes = new List<byte>();
|
||||||
while (r.PeekChar() != 0)
|
while (r.PeekChar() != 0)
|
||||||
{
|
|
||||||
gameBytes.Add(r.ReadByte());
|
gameBytes.Add(r.ReadByte());
|
||||||
}
|
|
||||||
// Advance past null byte.
|
// Advance past null byte.
|
||||||
r.ReadByte();
|
r.ReadByte();
|
||||||
string gameName = System.Text.Encoding.UTF8.GetString(gameBytes.ToArray());
|
string gameName = System.Text.Encoding.UTF8.GetString(gameBytes.ToArray());
|
||||||
|
@ -383,9 +381,7 @@ namespace BizHawk.MultiClient
|
||||||
*/
|
*/
|
||||||
List<byte> authorBytes = new List<byte>();
|
List<byte> authorBytes = new List<byte>();
|
||||||
while (r.PeekChar() != 0)
|
while (r.PeekChar() != 0)
|
||||||
{
|
|
||||||
authorBytes.Add(r.ReadByte());
|
authorBytes.Add(r.ReadByte());
|
||||||
}
|
|
||||||
// Advance past null byte.
|
// Advance past null byte.
|
||||||
r.ReadByte();
|
r.ReadByte();
|
||||||
string author = System.Text.Encoding.UTF8.GetString(authorBytes.ToArray());
|
string author = System.Text.Encoding.UTF8.GetString(authorBytes.ToArray());
|
||||||
|
@ -401,13 +397,13 @@ namespace BizHawk.MultiClient
|
||||||
SimpleController controllers = new SimpleController();
|
SimpleController controllers = new SimpleController();
|
||||||
controllers.Type = new ControllerDefinition();
|
controllers.Type = new ControllerDefinition();
|
||||||
controllers.Type.Name = "NES Controller";
|
controllers.Type.Name = "NES Controller";
|
||||||
if ((int)(update & 0x128) != 0)
|
if ((int)(update & 0x80) != 0)
|
||||||
{
|
{
|
||||||
// Control update: 1aabbbbb
|
// Control update: 1aabbbbb
|
||||||
bool reset = false;
|
bool reset = false;
|
||||||
int command = update & 0x1F;
|
int command = update & 0x1F;
|
||||||
/*
|
/*
|
||||||
bbbbb:
|
bbbbb:
|
||||||
** 0 Do nothing
|
** 0 Do nothing
|
||||||
** 1 Reset
|
** 1 Reset
|
||||||
** 2 Power cycle
|
** 2 Power cycle
|
||||||
|
@ -486,14 +482,15 @@ namespace BizHawk.MultiClient
|
||||||
* 7 Right
|
* 7 Right
|
||||||
*/
|
*/
|
||||||
int button = update & 7;
|
int button = update & 7;
|
||||||
|
controllers["P" + player + " " + buttons[button]] = !controllers["P" + player + " " + buttons[button]];
|
||||||
}
|
}
|
||||||
// aa: Number of delta bytes to follow
|
// aa: Number of delta bytes to follow
|
||||||
int delta = (update >> 5) & 3;
|
int delta = (update >> 5) & 3;
|
||||||
|
r.ReadBytes(delta);
|
||||||
MnemonicsGenerator mg = new MnemonicsGenerator();
|
MnemonicsGenerator mg = new MnemonicsGenerator();
|
||||||
mg.SetSource(controllers);
|
mg.SetSource(controllers);
|
||||||
string mnemonic = mg.GetControllersAsMnemonic();
|
string mnemonic = mg.GetControllersAsMnemonic();
|
||||||
while (false)
|
m.AppendFrame(mnemonic);
|
||||||
m.AppendFrame(mnemonic);
|
|
||||||
frame++;
|
frame++;
|
||||||
}
|
}
|
||||||
m.Header.SetHeaderLine(MovieHeader.FOURSCORE, fourscore.ToString());
|
m.Header.SetHeaderLine(MovieHeader.FOURSCORE, fourscore.ToString());
|
||||||
|
|
Loading…
Reference in New Issue