MultiHawk - some misc stuff

This commit is contained in:
adelikat 2015-03-02 01:06:02 +00:00
parent b16d41e92b
commit a3f6f71c64
4 changed files with 78 additions and 57 deletions

View File

@ -164,7 +164,7 @@ namespace BizHawk.Client.MultiHawk
var args = str.Split(' ');
if (args[0] == "Framebuffer")
{
Global.Emulator.VideoProvider().GetVideoBuffer().ReadFromHex(args[1]);
Emulator.VideoProvider().GetVideoBuffer().ReadFromHex(args[1]);
}
}
}
@ -278,7 +278,7 @@ namespace BizHawk.Client.MultiHawk
out_h /= 2;
}
using (new SimpleTime("Save Framebuffer"))
bs.PutLump(BinaryStateLump.Framebuffer, (s) => QuickBmpFile.Save(Global.Emulator.VideoProvider(), s, out_w, out_h));
bs.PutLump(BinaryStateLump.Framebuffer, (s) => QuickBmpFile.Save(Emulator.VideoProvider(), s, out_w, out_h));
}
if (IAmMaster)
@ -289,7 +289,7 @@ namespace BizHawk.Client.MultiHawk
delegate(TextWriter tw)
{
// this never should have been a core's responsibility
tw.WriteLine("Frame {0}", Global.Emulator.Frame);
tw.WriteLine("Frame {0}", Emulator.Frame);
Global.MovieSession.HandleMovieSaveState(tw);
});
}
@ -398,7 +398,7 @@ namespace BizHawk.Client.MultiHawk
}
var writer = new BinaryWriter(new FileStream(path, FileMode.Create, FileAccess.Write));
var saveram = Global.Emulator.AsSaveRam().CloneSaveRam();
var saveram = Emulator.AsSaveRam().CloneSaveRam();
writer.Write(saveram, 0, saveram.Length);
writer.Close();

View File

@ -44,6 +44,11 @@
this.RebootCoresMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.ExitMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ViewSubMenu = new System.Windows.Forms.ToolStripMenuItem();
this._1xMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this._2xMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this._3xMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this._4xMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MovieSubMenu = new System.Windows.Forms.ToolStripMenuItem();
this.RecordMovieMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.PlayMovieMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -61,11 +66,6 @@
this.FameStatusBarLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.StatusBarMessageLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.PlayRecordStatusButton = new System.Windows.Forms.ToolStripDropDownButton();
this.ViewSubMenu = new System.Windows.Forms.ToolStripMenuItem();
this._1xMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this._2xMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this._3xMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this._4xMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MainformMenu.SuspendLayout();
this.WorkspacePanel.SuspendLayout();
this.MainStatusBar.SuspendLayout();
@ -145,7 +145,7 @@
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(149, 6);
this.toolStripSeparator6.Size = new System.Drawing.Size(57, 6);
//
// toolStripSeparator7
//
@ -173,7 +173,7 @@
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(57, 6);
//
// toolStripSeparator5
//
@ -200,6 +200,46 @@
this.ExitMenuItem.Text = "E&xit";
this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click);
//
// ViewSubMenu
//
this.ViewSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this._1xMenuItem,
this._2xMenuItem,
this._3xMenuItem,
this._4xMenuItem});
this.ViewSubMenu.Name = "ViewSubMenu";
this.ViewSubMenu.Size = new System.Drawing.Size(44, 20);
this.ViewSubMenu.Text = "&View";
this.ViewSubMenu.DropDownOpened += new System.EventHandler(this.ViewSubMenu_DropDownOpened);
//
// _1xMenuItem
//
this._1xMenuItem.Name = "_1xMenuItem";
this._1xMenuItem.Size = new System.Drawing.Size(85, 22);
this._1xMenuItem.Text = "&1x";
this._1xMenuItem.Click += new System.EventHandler(this._1xMenuItem_Click);
//
// _2xMenuItem
//
this._2xMenuItem.Name = "_2xMenuItem";
this._2xMenuItem.Size = new System.Drawing.Size(85, 22);
this._2xMenuItem.Text = "&2x";
this._2xMenuItem.Click += new System.EventHandler(this._2xMenuItem_Click);
//
// _3xMenuItem
//
this._3xMenuItem.Name = "_3xMenuItem";
this._3xMenuItem.Size = new System.Drawing.Size(85, 22);
this._3xMenuItem.Text = "&3x";
this._3xMenuItem.Click += new System.EventHandler(this._3xMenuItem_Click);
//
// _4xMenuItem
//
this._4xMenuItem.Name = "_4xMenuItem";
this._4xMenuItem.Size = new System.Drawing.Size(85, 22);
this._4xMenuItem.Text = "&4x";
this._4xMenuItem.Click += new System.EventHandler(this._4xMenuItem_Click);
//
// MovieSubMenu
//
this.MovieSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -307,8 +347,8 @@
this.MainStatusBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripStatusLabel1,
this.FameStatusBarLabel,
this.StatusBarMessageLabel,
this.PlayRecordStatusButton});
this.PlayRecordStatusButton,
this.StatusBarMessageLabel});
this.MainStatusBar.Location = new System.Drawing.Point(0, 379);
this.MainStatusBar.Name = "MainStatusBar";
this.MainStatusBar.Size = new System.Drawing.Size(651, 22);
@ -342,46 +382,6 @@
this.PlayRecordStatusButton.Size = new System.Drawing.Size(29, 20);
this.PlayRecordStatusButton.Text = "No movie is active";
//
// ViewSubMenu
//
this.ViewSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this._1xMenuItem,
this._2xMenuItem,
this._3xMenuItem,
this._4xMenuItem});
this.ViewSubMenu.Name = "ViewSubMenu";
this.ViewSubMenu.Size = new System.Drawing.Size(44, 20);
this.ViewSubMenu.Text = "&View";
this.ViewSubMenu.DropDownOpened += new System.EventHandler(this.ViewSubMenu_DropDownOpened);
//
// _1xMenuItem
//
this._1xMenuItem.Name = "_1xMenuItem";
this._1xMenuItem.Size = new System.Drawing.Size(152, 22);
this._1xMenuItem.Text = "&1x";
this._1xMenuItem.Click += new System.EventHandler(this._1xMenuItem_Click);
//
// _2xMenuItem
//
this._2xMenuItem.Name = "_2xMenuItem";
this._2xMenuItem.Size = new System.Drawing.Size(152, 22);
this._2xMenuItem.Text = "&2x";
this._2xMenuItem.Click += new System.EventHandler(this._2xMenuItem_Click);
//
// _3xMenuItem
//
this._3xMenuItem.Name = "_3xMenuItem";
this._3xMenuItem.Size = new System.Drawing.Size(152, 22);
this._3xMenuItem.Text = "&3x";
this._3xMenuItem.Click += new System.EventHandler(this._3xMenuItem_Click);
//
// _4xMenuItem
//
this._4xMenuItem.Name = "_4xMenuItem";
this._4xMenuItem.Size = new System.Drawing.Size(152, 22);
this._4xMenuItem.Text = "&4x";
this._4xMenuItem.Click += new System.EventHandler(this._4xMenuItem_Click);
//
// Mainform
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View File

@ -933,7 +933,6 @@ namespace BizHawk.Client.MultiHawk
var runFrame = false;
_runloopFrameadvance = false;
var currentTimestamp = Stopwatch.GetTimestamp();
var suppressCaptureRewind = false;
double frameAdvanceTimestampDeltaMs = (double)(currentTimestamp - _frameAdvanceTimestamp) / Stopwatch.Frequency * 1000.0;
bool frameProgressTimeElapsed = frameAdvanceTimestampDeltaMs >= Global.Config.FrameProgressDelayMs;
@ -1052,17 +1051,20 @@ namespace BizHawk.Client.MultiHawk
private void RecordMovieMenuItem_Click(object sender, EventArgs e)
{
new RecordMovie().ShowDialog();
UpdateMainText();
}
private void PlayMovieMenuItem_Click(object sender, EventArgs e)
{
new PlayMovie().ShowDialog();
UpdateMainText();
}
private void StopMovieMenuItem_Click(object sender, EventArgs e)
{
Global.MovieSession.StopMovie(true);
SetMainformMovieInfo();
UpdateMainText();
//UpdateStatusSlots(); // TODO
}
@ -1243,6 +1245,7 @@ namespace BizHawk.Client.MultiHawk
EmulatorWindows.SessionName = file.FullName;
Global.Config.RecentRomSessions.Add(file.FullName);
SaveSessionMenuItem_Click(sender, e);
UpdateMainText();
}
}
}
@ -1287,9 +1290,27 @@ namespace BizHawk.Client.MultiHawk
EmulatorWindows.SessionName = file.FullName;
LoadRomSession(EmulatorWindowList.FromJson(json));
Global.Config.RecentRomSessions.Add(file.FullName);
UpdateMainText();
}
}
private void UpdateMainText()
{
string text = "MultiHawk";
if (!string.IsNullOrWhiteSpace(EmulatorWindows.SessionName))
{
text += " - " + Path.GetFileNameWithoutExtension(EmulatorWindows.SessionName);
}
if (Global.MovieSession.Movie.IsActive)
{
text += " - " + Path.GetFileNameWithoutExtension(Global.MovieSession.Movie.Filename);
}
Text = text;
}
private static FileInfo GetFileFromUser(string filter)
{
var ofd = new OpenFileDialog
@ -1326,6 +1347,7 @@ namespace BizHawk.Client.MultiHawk
}
EmulatorWindows.Clear();
UpdateMainText();
}
private void LoadRomSession(IEnumerable<EmulatorWindowList.RomSessionEntry> entries)
@ -1334,6 +1356,7 @@ namespace BizHawk.Client.MultiHawk
{
LoadRom(entry.RomName);
EmulatorWindows.Last().Location = new Point(entry.Wndx, entry.Wndy);
UpdateMainText();
}
}
@ -1347,6 +1370,7 @@ namespace BizHawk.Client.MultiHawk
EmulatorWindows.SessionName = file.FullName;
LoadRomSession(EmulatorWindowList.FromJson(json));
Global.Config.RecentRomSessions.Add(file.FullName);
UpdateMainText();
}
else
{

View File

@ -123,7 +123,4 @@
<metadata name="MainStatusBar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>153, 17</value>
</metadata>
<metadata name="MainStatusBar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>153, 17</value>
</metadata>
</root>