From 453eef6da212ad5f898fde1a470d238fbfcd6afe Mon Sep 17 00:00:00 2001 From: adelikat Date: Mon, 26 Nov 2012 01:28:14 +0000 Subject: [PATCH] C64 - Statusbar now has a floppy disk led light, lights up when emulated floppy disk is in use --- .../BizHawk.MultiClient.csproj | 2 + BizHawk.MultiClient/MainForm.Designer.cs | 46 +++++++++++-------- BizHawk.MultiClient/MainForm.cs | 29 ++++++++++++ .../Properties/Resources.Designer.cs | 14 ++++++ BizHawk.MultiClient/Properties/Resources.resx | 6 +++ 5 files changed, 79 insertions(+), 18 deletions(-) diff --git a/BizHawk.MultiClient/BizHawk.MultiClient.csproj b/BizHawk.MultiClient/BizHawk.MultiClient.csproj index 59026c306c..156c2e9846 100644 --- a/BizHawk.MultiClient/BizHawk.MultiClient.csproj +++ b/BizHawk.MultiClient/BizHawk.MultiClient.csproj @@ -960,6 +960,8 @@ + + diff --git a/BizHawk.MultiClient/MainForm.Designer.cs b/BizHawk.MultiClient/MainForm.Designer.cs index 7119f5ed1e..4d5f9aa23e 100644 --- a/BizHawk.MultiClient/MainForm.Designer.cs +++ b/BizHawk.MultiClient/MainForm.Designer.cs @@ -267,6 +267,8 @@ this.toolStripSeparator18 = new System.Windows.Forms.ToolStripSeparator(); this.graphicsDebuggerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.loadGBInSGBToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.colecoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.skipBIOSIntroToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.helpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.forumsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -278,6 +280,7 @@ this.PauseStrip = new System.Windows.Forms.ToolStripDropDownButton(); this.RebootStatusBarIcon = new System.Windows.Forms.ToolStripStatusLabel(); this.AVIStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); + this.StatusBarLedLight = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.StatusSlot1 = new System.Windows.Forms.ToolStripStatusLabel(); this.StatusSlot2 = new System.Windows.Forms.ToolStripStatusLabel(); @@ -311,8 +314,6 @@ this.cmiScreenshotClipboard = new System.Windows.Forms.ToolStripMenuItem(); this.cmiCloseRom = new System.Windows.Forms.ToolStripMenuItem(); this.cmiShowMenu = new System.Windows.Forms.ToolStripMenuItem(); - this.colecoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.skipBIOSIntroToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.StatusSlot0.SuspendLayout(); this.contextMenuStrip1.SuspendLayout(); @@ -2313,6 +2314,22 @@ this.loadGBInSGBToolStripMenuItem.Text = "Load GB in SGB"; this.loadGBInSGBToolStripMenuItem.Click += new System.EventHandler(this.loadGBInSGBToolStripMenuItem_Click); // + // colecoToolStripMenuItem + // + this.colecoToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.skipBIOSIntroToolStripMenuItem}); + this.colecoToolStripMenuItem.Name = "colecoToolStripMenuItem"; + this.colecoToolStripMenuItem.Size = new System.Drawing.Size(56, 19); + this.colecoToolStripMenuItem.Text = "&Coleco"; + this.colecoToolStripMenuItem.DropDownOpened += new System.EventHandler(this.colecoToolStripMenuItem_DropDownOpened); + // + // skipBIOSIntroToolStripMenuItem + // + this.skipBIOSIntroToolStripMenuItem.Name = "skipBIOSIntroToolStripMenuItem"; + this.skipBIOSIntroToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.skipBIOSIntroToolStripMenuItem.Text = "&Skip BIOS intro"; + this.skipBIOSIntroToolStripMenuItem.Click += new System.EventHandler(this.skipBIOIntroToolStripMenuItem_Click); + // // helpToolStripMenuItem // this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -2356,6 +2373,7 @@ this.PauseStrip, this.RebootStatusBarIcon, this.AVIStatusLabel, + this.StatusBarLedLight, this.toolStripStatusLabel1, this.StatusSlot1, this.StatusSlot2, @@ -2434,6 +2452,13 @@ this.AVIStatusLabel.Size = new System.Drawing.Size(16, 17); this.AVIStatusLabel.Text = "AVI Capture"; // + // StatusBarLedLight + // + this.StatusBarLedLight.Image = global::BizHawk.MultiClient.Properties.Resources.LightOff; + this.StatusBarLedLight.Name = "StatusBarLedLight"; + this.StatusBarLedLight.Size = new System.Drawing.Size(16, 17); + this.StatusBarLedLight.ToolTipText = "Disk Drive LED Light"; + // // toolStripStatusLabel1 // this.toolStripStatusLabel1.BackColor = System.Drawing.SystemColors.Control; @@ -2690,22 +2715,6 @@ this.cmiShowMenu.Text = "Show Menu"; this.cmiShowMenu.Click += new System.EventHandler(this.showMenuToolStripMenuItem_Click); // - // colecoToolStripMenuItem - // - this.colecoToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.skipBIOSIntroToolStripMenuItem}); - this.colecoToolStripMenuItem.Name = "colecoToolStripMenuItem"; - this.colecoToolStripMenuItem.Size = new System.Drawing.Size(56, 19); - this.colecoToolStripMenuItem.Text = "&Coleco"; - this.colecoToolStripMenuItem.DropDownOpened += new System.EventHandler(this.colecoToolStripMenuItem_DropDownOpened); - // - // skipBIOIntroToolStripMenuItem - // - this.skipBIOSIntroToolStripMenuItem.Name = "skipBIOSIntroToolStripMenuItem"; - this.skipBIOSIntroToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.skipBIOSIntroToolStripMenuItem.Text = "&Skip BIOS intro"; - this.skipBIOSIntroToolStripMenuItem.Click += new System.EventHandler(this.skipBIOIntroToolStripMenuItem_Click); - // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 14F); @@ -3030,6 +3039,7 @@ private System.Windows.Forms.ToolStripSeparator toolStripSeparator28; private System.Windows.Forms.ToolStripMenuItem colecoToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem skipBIOSIntroToolStripMenuItem; + private System.Windows.Forms.ToolStripStatusLabel StatusBarLedLight; } } diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index b3e00c03ef..d3e0d14476 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -2501,6 +2501,7 @@ namespace BizHawk.MultiClient void StepRunLoop_Core() { + HandleToggleLight(); bool runFrame = false; runloop_frameadvance = false; DateTime now = DateTime.Now; @@ -4525,5 +4526,33 @@ namespace BizHawk.MultiClient skipBIOSIntroToolStripMenuItem.Checked = Global.Config.ColecoSkipBiosIntro; } + private void HandleToggleLight() + { + if (StatusSlot0.Visible) + { + if (Global.Emulator is C64) + { + if (!StatusBarLedLight.Visible) + { + StatusBarLedLight.Visible = true; + } + if ((Global.Emulator as C64).DriveLED) + { + StatusBarLedLight.Image = BizHawk.MultiClient.Properties.Resources.LightOn; + } + else + { + StatusBarLedLight.Image = BizHawk.MultiClient.Properties.Resources.LightOff; + } + } + else + { + if (StatusBarLedLight.Visible) + { + StatusBarLedLight.Visible = false; + } + } + } + } } } diff --git a/BizHawk.MultiClient/Properties/Resources.Designer.cs b/BizHawk.MultiClient/Properties/Resources.Designer.cs index b68c6ad9c5..1a417dd3d3 100644 --- a/BizHawk.MultiClient/Properties/Resources.Designer.cs +++ b/BizHawk.MultiClient/Properties/Resources.Designer.cs @@ -396,6 +396,20 @@ namespace BizHawk.MultiClient.Properties { } } + internal static System.Drawing.Bitmap LightOff { + get { + object obj = ResourceManager.GetObject("LightOff", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap LightOn { + get { + object obj = ResourceManager.GetObject("LightOn", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + internal static System.Drawing.Bitmap LoadConfig { get { object obj = ResourceManager.GetObject("LoadConfig", resourceCulture); diff --git a/BizHawk.MultiClient/Properties/Resources.resx b/BizHawk.MultiClient/Properties/Resources.resx index 476f973b70..a21bb1302a 100644 --- a/BizHawk.MultiClient/Properties/Resources.resx +++ b/BizHawk.MultiClient/Properties/Resources.resx @@ -852,4 +852,10 @@ ..\images\C64Symbol.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\LightOff.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\images\LightOn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file