Input display now shows the previous frame input as well. The display currently doesn't look good, but I will improve on that soon. Save last input into NES savestates

This commit is contained in:
andres.delikat 2011-05-01 21:19:18 +00:00
parent 6a409e9b73
commit becbbc88ea
3 changed files with 16 additions and 2 deletions
BizHawk.Emulation/Consoles/Nintendo/NES
BizHawk.MultiClient

View File

@ -489,6 +489,8 @@ namespace BizHawk.Emulation.Consoles.Nintendo
ser.Sync("ram", ref ram, false);
ser.Sync("CIRAM", ref CIRAM, false);
ser.Sync("cpu_accumulate", ref cpu_accumulate);
string inp = GetControllersAsMnemonic();
ser.SyncFixedString("input", ref inp, 32);
board.SyncState(ser);
ppu.SyncState(ser);
ser.EndSection();

View File

@ -35,6 +35,7 @@ namespace BizHawk.MultiClient
int runloop_fps;
bool runloop_frameadvance;
DateTime runloop_second;
public string wasPressed = ""; //Last frame mnemonic
Throttle throttle = new Throttle();
int rewindCredits;
@ -914,6 +915,7 @@ namespace BizHawk.MultiClient
UnpauseEmulator();
}
}
wasPressed = Global.Emulator.GetControllersAsMnemonic();
}
else
{

View File

@ -267,8 +267,10 @@ namespace BizHawk.MultiClient
}
if (Global.Config.DisplayInput)
{
string input = MakeInputDisplay();
MessageFont.DrawString(null, input, Global.Config.DispInpx+1, Global.Config.DispInpy+1, new Color4(Color.Black));
string input = MakeLastInputDisplay();
MessageFont.DrawString(null, input, Global.Config.DispInpx+2, Global.Config.DispInpy+2, new Color4(Color.Black));
MessageFont.DrawString(null, input, Global.Config.DispInpx+1, Global.Config.DispInpy+1, Color.FromArgb(Global.Config.MessagesColor));
input = MakeInputDisplay();
MessageFont.DrawString(null, input, Global.Config.DispInpx, Global.Config.DispInpy, Color.FromArgb(Global.Config.MessagesColor));
}
@ -357,6 +359,14 @@ namespace BizHawk.MultiClient
tmp = tmp.Replace("|", "");
return tmp;
}
public string MakeLastInputDisplay()
{
string tmp = Global.MainForm.wasPressed;
tmp = tmp.Replace(".", " ");
tmp = tmp.Replace("|", "");
return tmp;
}
}
class UIMessage