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

View File

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

View File

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

View File

@ -267,8 +267,10 @@ namespace BizHawk.MultiClient
} }
if (Global.Config.DisplayInput) if (Global.Config.DisplayInput)
{ {
string input = MakeInputDisplay(); string input = MakeLastInputDisplay();
MessageFont.DrawString(null, input, Global.Config.DispInpx+1, Global.Config.DispInpy+1, new Color4(Color.Black)); 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)); 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("|", ""); tmp = tmp.Replace("|", "");
return tmp; return tmp;
} }
public string MakeLastInputDisplay()
{
string tmp = Global.MainForm.wasPressed;
tmp = tmp.Replace(".", " ");
tmp = tmp.Replace("|", "");
return tmp;
}
} }
class UIMessage class UIMessage