Add GetControllerAsMneumonic() to IEmulator that returns a formatted string of controller inputs. Implemented this function in SMS input.cs and hooked up Movie recording.
This commit is contained in:
parent
c59b9ff6ce
commit
0ed57b443b
|
@ -27,6 +27,8 @@ namespace BizHawk.Emulation.Consoles.Calculator
|
||||||
bool m_CursorMoved;
|
bool m_CursorMoved;
|
||||||
//-------
|
//-------
|
||||||
|
|
||||||
|
public string GetControllersAsMneumonic() { return "|.|0|"; } //TODO: Implement this
|
||||||
|
|
||||||
public byte ReadMemory(ushort addr)
|
public byte ReadMemory(ushort addr)
|
||||||
{
|
{
|
||||||
int romPage = romPageLow3Bits | (romPageHighBit << 3);
|
int romPage = romPageLow3Bits | (romPageHighBit << 3);
|
||||||
|
|
|
@ -11,6 +11,11 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public string GetControllersAsMneumonic()
|
||||||
|
{
|
||||||
|
return "|........|0|";
|
||||||
|
}
|
||||||
|
|
||||||
public ControllerDefinition ControllerDefinition { get { return GbController; } }
|
public ControllerDefinition ControllerDefinition { get { return GbController; } }
|
||||||
public IController Controller { get; set; }
|
public IController Controller { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,5 +165,10 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string GetControllersAsMneumonic()
|
||||||
|
{
|
||||||
|
return "|........|........|0|"; //TODO: implement
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -12,6 +12,12 @@
|
||||||
public ControllerDefinition ControllerDefinition { get { return PCEngineController; } }
|
public ControllerDefinition ControllerDefinition { get { return PCEngineController; } }
|
||||||
public IController Controller { get; set; }
|
public IController Controller { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public string GetControllersAsMneumonic()
|
||||||
|
{
|
||||||
|
return "|........|0|"; //TODO: implement
|
||||||
|
}
|
||||||
|
|
||||||
private byte inputSelector;
|
private byte inputSelector;
|
||||||
public bool SEL { get { return ((inputSelector & 1) != 0) ;} }
|
public bool SEL { get { return ((inputSelector & 1) != 0) ;} }
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,12 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
public string GetControllersAsMneumonic()
|
||||||
|
{
|
||||||
|
return "|........|0|"; //TODO: implement
|
||||||
|
}
|
||||||
|
|
||||||
public ControllerDefinition ControllerDefinition { get { return GenesisController; } }
|
public ControllerDefinition ControllerDefinition { get { return GenesisController; } }
|
||||||
public IController Controller { get; set; }
|
public IController Controller { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,48 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
public string GetControllersAsMneumonic()
|
||||||
|
{
|
||||||
|
string input = "|";
|
||||||
|
|
||||||
|
if (Controller.IsPressed("P1 Up")) input += "U";
|
||||||
|
else input += ".";
|
||||||
|
if (Controller.IsPressed("P1 Down")) input += "D";
|
||||||
|
else input += ".";
|
||||||
|
if (Controller.IsPressed("P1 Left")) input += "L";
|
||||||
|
else input += ".";
|
||||||
|
if (Controller.IsPressed("P1 Right")) input += "R";
|
||||||
|
else input += ".";
|
||||||
|
if (Controller.IsPressed("P1 B1")) input += "1";
|
||||||
|
else input += ".";
|
||||||
|
if (Controller.IsPressed("P1 B2")) input += "2";
|
||||||
|
else input += ".";
|
||||||
|
if (Controller.IsPressed("P2 Up")) input += "U";
|
||||||
|
else input += ".";
|
||||||
|
if (Controller.IsPressed("P2 Down")) input += "D";
|
||||||
|
else input += ".";
|
||||||
|
if (Controller.IsPressed("P2 Left")) input += "L";
|
||||||
|
else input += ".";
|
||||||
|
if (Controller.IsPressed("P2 Right")) input += "R";
|
||||||
|
else input += ".";
|
||||||
|
if (Controller.IsPressed("P2 B1")) input += "1";
|
||||||
|
else input += ".";
|
||||||
|
if (Controller.IsPressed("P2 B2")) input += "2";
|
||||||
|
else input += ".";
|
||||||
|
if (Controller.IsPressed("Pause")) input += "S";
|
||||||
|
else input += ".";
|
||||||
|
|
||||||
|
input += "|";
|
||||||
|
|
||||||
|
if (Controller.IsPressed("Reset")) input += "R";
|
||||||
|
else input += "0";
|
||||||
|
|
||||||
|
input += "|";
|
||||||
|
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
public ControllerDefinition ControllerDefinition { get { return SmsController; } }
|
public ControllerDefinition ControllerDefinition { get { return SmsController; } }
|
||||||
public IController Controller { get; set; }
|
public IController Controller { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,9 @@ namespace BizHawk
|
||||||
}
|
}
|
||||||
public ControllerDefinition ControllerDefinition { get { return NullController; } }
|
public ControllerDefinition ControllerDefinition { get { return NullController; } }
|
||||||
public IController Controller { get; set; }
|
public IController Controller { get; set; }
|
||||||
|
|
||||||
|
public string GetControllersAsMneumonic() { return "|.|0|"; }
|
||||||
|
|
||||||
public int Frame { get; set; }
|
public int Frame { get; set; }
|
||||||
public byte[] SaveRam { get { return new byte[0]; } }
|
public byte[] SaveRam { get { return new byte[0]; } }
|
||||||
public bool DeterministicEmulation { get; set; }
|
public bool DeterministicEmulation { get; set; }
|
||||||
|
|
|
@ -12,6 +12,8 @@ namespace BizHawk
|
||||||
ControllerDefinition ControllerDefinition { get; }
|
ControllerDefinition ControllerDefinition { get; }
|
||||||
IController Controller { get; set; }
|
IController Controller { get; set; }
|
||||||
|
|
||||||
|
string GetControllersAsMneumonic();
|
||||||
|
|
||||||
void LoadGame(IGame game);
|
void LoadGame(IGame game);
|
||||||
void FrameAdvance(bool render);
|
void FrameAdvance(bool render);
|
||||||
|
|
||||||
|
|
|
@ -128,13 +128,13 @@ namespace BizHawk.MultiClient
|
||||||
//p.ShowDialog();
|
//p.ShowDialog();
|
||||||
|
|
||||||
//Hacky testing
|
//Hacky testing
|
||||||
InputLog.LoadMovie();
|
//InputLog.LoadMovie();
|
||||||
InputLog.WriteMovie();
|
//InputLog.WriteMovie();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void stopMovieToolStripMenuItem_Click(object sender, EventArgs e)
|
private void stopMovieToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
InputLog.StopMovie(); //TODO: stop user movie if it exists, and start InputLog logging, else do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
private void playFromBeginningToolStripMenuItem_Click(object sender, EventArgs e)
|
private void playFromBeginningToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
|
|
@ -425,6 +425,7 @@ namespace BizHawk.MultiClient
|
||||||
new BizHawk.Emulation.Consoles.Gameboy.Debugger(Global.Emulator as Gameboy).Show();
|
new BizHawk.Emulation.Consoles.Gameboy.Debugger(Global.Emulator as Gameboy).Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InputLog.StartNewRecording();
|
||||||
|
|
||||||
//setup the throttle based on platform's specifications
|
//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)
|
//(one day later for some systems we will need to modify it at runtime as the display mode changes)
|
||||||
|
@ -469,11 +470,12 @@ namespace BizHawk.MultiClient
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This functions calls Emulator.FrameAdvance(true) and handles any updates that need to happen on a per frame basis
|
/// This functions calls Emulator.FrameAdvance(true) and handles any updates that need to happen on a per frame basis
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void DoFrameAdvance()
|
public void DoFrameAdvance() //TODO: rename this and run it once per frame
|
||||||
{
|
{
|
||||||
Global.Emulator.FrameAdvance(true); //TODO: Do these things need to happen on (false) as well? Think about it
|
Global.Emulator.FrameAdvance(true); //TODO: Do these things need to happen on (false) as well? Think about it
|
||||||
RamWatch1.UpdateValues();
|
RamWatch1.UpdateValues();
|
||||||
RamSearch1.UpdateValues();
|
RamSearch1.UpdateValues();
|
||||||
|
InputLog.GetMneumonic(); //TODO: log to input log or user choice, if user choice & playback don't log!
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CheckHotkeys()
|
public void CheckHotkeys()
|
||||||
|
@ -635,6 +637,7 @@ namespace BizHawk.MultiClient
|
||||||
Global.Emulator.FrameAdvance(!throttle.skipnextframe);
|
Global.Emulator.FrameAdvance(!throttle.skipnextframe);
|
||||||
RamWatch1.UpdateValues();
|
RamWatch1.UpdateValues();
|
||||||
RamSearch1.UpdateValues();
|
RamSearch1.UpdateValues();
|
||||||
|
InputLog.GetMneumonic();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(genSound)
|
if(genSound)
|
||||||
|
|
|
@ -6,6 +6,7 @@ using System.IO;
|
||||||
|
|
||||||
namespace BizHawk.MultiClient
|
namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
|
public enum MOVIEMODE { INACTIVE, PLAY, RECORD, FINISHED };
|
||||||
class Movie
|
class Movie
|
||||||
{
|
{
|
||||||
private MovieHeader Header = new MovieHeader();
|
private MovieHeader Header = new MovieHeader();
|
||||||
|
@ -14,10 +15,35 @@ namespace BizHawk.MultiClient
|
||||||
private bool IsText = true;
|
private bool IsText = true;
|
||||||
private string Filename;
|
private string Filename;
|
||||||
|
|
||||||
|
private MOVIEMODE MovieMode = new MOVIEMODE();
|
||||||
|
|
||||||
public Movie(string filename)
|
public Movie(string filename)
|
||||||
{
|
{
|
||||||
Filename = filename; //TODO: Validate that file is writable
|
Filename = filename; //TODO: Validate that file is writable
|
||||||
Log.AddFrame("|........|0|");
|
MovieMode = MOVIEMODE.PLAY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StopMovie()
|
||||||
|
{
|
||||||
|
MovieMode = MOVIEMODE.INACTIVE;
|
||||||
|
WriteMovie();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StartNewRecording()
|
||||||
|
{
|
||||||
|
MovieMode = MOVIEMODE.RECORD;
|
||||||
|
Log.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MOVIEMODE GetMovieMode()
|
||||||
|
{
|
||||||
|
return MovieMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void GetMneumonic()
|
||||||
|
{
|
||||||
|
if (MovieMode == MOVIEMODE.RECORD)
|
||||||
|
Log.AddFrame(Global.Emulator.GetControllersAsMneumonic());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddMovieRecord()
|
public void AddMovieRecord()
|
||||||
|
|
|
@ -1,6 +1,170 @@
|
||||||
EmulationVersion v1.0.0
|
EmulationVersion v1.0.0
|
||||||
MovieVersion v1.0.0
|
MovieVersion v1.0.0
|
||||||
Platform PCE
|
Platform
|
||||||
GameName Bonk.pce
|
GameName
|
||||||
|........|0|
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|..L..........|0|
|
||||||
|
|..L..........|0|
|
||||||
|
|..L..........|0|
|
||||||
|
|..L..........|0|
|
||||||
|
|..L..........|0|
|
||||||
|
|..L..........|0|
|
||||||
|
|..L..........|0|
|
||||||
|
|.D...........|0|
|
||||||
|
|.D...........|0|
|
||||||
|
|.D...........|0|
|
||||||
|
|.D...........|0|
|
||||||
|
|.D...........|0|
|
||||||
|
|..L..........|0|
|
||||||
|
|..L..........|0|
|
||||||
|
|..L..........|0|
|
||||||
|
|..L..........|0|
|
||||||
|
|..L..........|0|
|
||||||
|
|..L..........|0|
|
||||||
|
|..L..........|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|....12.......|0|
|
||||||
|
|U...12.......|0|
|
||||||
|
|U...12.......|0|
|
||||||
|
|U...12.......|0|
|
||||||
|
|U...12.......|0|
|
||||||
|
|U...12.......|0|
|
||||||
|
|.............|0|
|
||||||
|
|.D...........|0|
|
||||||
|
|.D...........|0|
|
||||||
|
|.D...........|0|
|
||||||
|
|..L..........|0|
|
||||||
|
|..L..........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|...R.........|0|
|
||||||
|
|U............|0|
|
||||||
|
|U............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|.............|0|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue