From 534f28942e29bd6e034dea73bc63955a3d310a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hein=20Andre=20Gr=C3=B8nnestad?= Date: Thu, 2 Apr 2020 23:42:48 +0200 Subject: [PATCH] #12 Added toolbar button for video frame debug outlines --- ComputerSystems/Commodore64/App.config | 3 + .../Commodore64/FormC64Screen.Designer.cs | 64 +++++++++++++------ ComputerSystems/Commodore64/FormC64Screen.cs | 8 ++- .../Commodore64/FormC64Screen.resx | 31 ++++++--- .../Properties/Settings.Designer.cs | 14 +++- .../Commodore64/Properties/Settings.settings | 3 + 6 files changed, 90 insertions(+), 33 deletions(-) diff --git a/ComputerSystems/Commodore64/App.config b/ComputerSystems/Commodore64/App.config index b2814c9..9832205 100644 --- a/ComputerSystems/Commodore64/App.config +++ b/ComputerSystems/Commodore64/App.config @@ -13,6 +13,9 @@ True + + False + \ No newline at end of file diff --git a/ComputerSystems/Commodore64/FormC64Screen.Designer.cs b/ComputerSystems/Commodore64/FormC64Screen.Designer.cs index ed31cf1..c9c09f9 100644 --- a/ComputerSystems/Commodore64/FormC64Screen.Designer.cs +++ b/ComputerSystems/Commodore64/FormC64Screen.Designer.cs @@ -30,6 +30,7 @@ private void InitializeComponent() { this.lblClockSpeed = new System.Windows.Forms.ToolStripStatusLabel(); this.lblCycles = new System.Windows.Forms.ToolStripStatusLabel(); this.lblInstructions = new System.Windows.Forms.ToolStripStatusLabel(); + this.lblIllegalInstructions = new System.Windows.Forms.ToolStripStatusLabel(); this.lblKeyboardDisabled = new System.Windows.Forms.ToolStripStatusLabel(); this.toolMain = new System.Windows.Forms.ToolStrip(); this.btnRestart = new System.Windows.Forms.ToolStripButton(); @@ -39,7 +40,6 @@ private void InitializeComponent() { this.btnOpen = new System.Windows.Forms.ToolStripButton(); this.btnSave = new System.Windows.Forms.ToolStripButton(); this.separator2 = new System.Windows.Forms.ToolStripSeparator(); - this.btnUseCrtFilter = new System.Windows.Forms.ToolStripButton(); this.separator3 = new System.Windows.Forms.ToolStripSeparator(); this.btnCopyOutput = new System.Windows.Forms.ToolStripSplitButton(); this.btnCopyRawOutput = new System.Windows.Forms.ToolStripMenuItem(); @@ -57,7 +57,9 @@ private void InitializeComponent() { this.lblVicCurrentLineCycle = new System.Windows.Forms.ToolStripStatusLabel(); this.lblVicGraphicsMode = new System.Windows.Forms.ToolStripStatusLabel(); this.lblVicScreenOn = new System.Windows.Forms.ToolStripStatusLabel(); - this.lblIllegalInstructions = new System.Windows.Forms.ToolStripStatusLabel(); + this.separator5 = new System.Windows.Forms.ToolStripSeparator(); + this.btnUseCrtFilter = new System.Windows.Forms.ToolStripButton(); + this.btnShowVideoFrameOutlines = new System.Windows.Forms.ToolStripButton(); ((System.ComponentModel.ISupportInitialize)(this.pScreen)).BeginInit(); this.statusMain.SuspendLayout(); this.toolMain.SuspendLayout(); @@ -124,11 +126,18 @@ private void InitializeComponent() { this.lblInstructions.Size = new System.Drawing.Size(82, 19); this.lblInstructions.Text = "0 instructions"; // + // lblIllegalInstructions + // + this.lblIllegalInstructions.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right; + this.lblIllegalInstructions.Name = "lblIllegalInstructions"; + this.lblIllegalInstructions.Size = new System.Drawing.Size(82, 19); + this.lblIllegalInstructions.Text = "0 instructions"; + // // lblKeyboardDisabled // this.lblKeyboardDisabled.ForeColor = System.Drawing.Color.Red; this.lblKeyboardDisabled.Name = "lblKeyboardDisabled"; - this.lblKeyboardDisabled.Size = new System.Drawing.Size(678, 19); + this.lblKeyboardDisabled.Size = new System.Drawing.Size(709, 19); this.lblKeyboardDisabled.Spring = true; this.lblKeyboardDisabled.Text = "Keyboard Disabled"; this.lblKeyboardDisabled.TextAlign = System.Drawing.ContentAlignment.MiddleRight; @@ -149,7 +158,9 @@ private void InitializeComponent() { this.separator4, this.btnDebugger, this.btnClockSpeedSlower, - this.btnClockSpeedFaster}); + this.btnClockSpeedFaster, + this.separator5, + this.btnShowVideoFrameOutlines}); this.toolMain.Location = new System.Drawing.Point(0, 0); this.toolMain.Name = "toolMain"; this.toolMain.Size = new System.Drawing.Size(1008, 25); @@ -217,18 +228,6 @@ private void InitializeComponent() { this.separator2.Name = "separator2"; this.separator2.Size = new System.Drawing.Size(6, 25); // - // btnUseCrtFilter - // - this.btnUseCrtFilter.Checked = global::Commodore64.Properties.Settings.Default.ApplyCrtFilter; - this.btnUseCrtFilter.CheckOnClick = true; - this.btnUseCrtFilter.CheckState = System.Windows.Forms.CheckState.Checked; - this.btnUseCrtFilter.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.btnUseCrtFilter.Image = ((System.Drawing.Image)(resources.GetObject("btnUseCrtFilter.Image"))); - this.btnUseCrtFilter.ImageTransparentColor = System.Drawing.Color.Magenta; - this.btnUseCrtFilter.Name = "btnUseCrtFilter"; - this.btnUseCrtFilter.Size = new System.Drawing.Size(23, 22); - this.btnUseCrtFilter.Text = "CRT filter"; - // // separator3 // this.separator3.Name = "separator3"; @@ -366,12 +365,33 @@ private void InitializeComponent() { this.lblVicScreenOn.Size = new System.Drawing.Size(49, 19); this.lblVicScreenOn.Text = "Screen:"; // - // lblIllegalInstructions + // separator5 // - this.lblIllegalInstructions.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right; - this.lblIllegalInstructions.Name = "lblIllegalInstructions"; - this.lblIllegalInstructions.Size = new System.Drawing.Size(82, 19); - this.lblIllegalInstructions.Text = "0 instructions"; + this.separator5.Name = "separator5"; + this.separator5.Size = new System.Drawing.Size(6, 25); + // + // btnUseCrtFilter + // + this.btnUseCrtFilter.Checked = global::Commodore64.Properties.Settings.Default.ApplyCrtFilter; + this.btnUseCrtFilter.CheckOnClick = true; + this.btnUseCrtFilter.CheckState = System.Windows.Forms.CheckState.Checked; + this.btnUseCrtFilter.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.btnUseCrtFilter.Image = ((System.Drawing.Image)(resources.GetObject("btnUseCrtFilter.Image"))); + this.btnUseCrtFilter.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btnUseCrtFilter.Name = "btnUseCrtFilter"; + this.btnUseCrtFilter.Size = new System.Drawing.Size(23, 22); + this.btnUseCrtFilter.Text = "CRT filter"; + // + // btnShowVideoFrameOutlines + // + this.btnShowVideoFrameOutlines.Checked = global::Commodore64.Properties.Settings.Default.ShowVideoFrameOutlines; + this.btnShowVideoFrameOutlines.CheckOnClick = true; + this.btnShowVideoFrameOutlines.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.btnShowVideoFrameOutlines.Image = ((System.Drawing.Image)(resources.GetObject("btnShowVideoFrameOutlines.Image"))); + this.btnShowVideoFrameOutlines.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btnShowVideoFrameOutlines.Name = "btnShowVideoFrameOutlines"; + this.btnShowVideoFrameOutlines.Size = new System.Drawing.Size(55, 22); + this.btnShowVideoFrameOutlines.Text = "Outlines"; // // FormC64Screen // @@ -437,5 +457,7 @@ private void InitializeComponent() { private System.Windows.Forms.ToolStripButton btnClockSpeedFaster; private System.Windows.Forms.ToolStripStatusLabel lblClockSpeed; private System.Windows.Forms.ToolStripStatusLabel lblIllegalInstructions; + private System.Windows.Forms.ToolStripSeparator separator5; + private System.Windows.Forms.ToolStripButton btnShowVideoFrameOutlines; } } \ No newline at end of file diff --git a/ComputerSystems/Commodore64/FormC64Screen.cs b/ComputerSystems/Commodore64/FormC64Screen.cs index 2a7a53b..9c0678a 100644 --- a/ComputerSystems/Commodore64/FormC64Screen.cs +++ b/ComputerSystems/Commodore64/FormC64Screen.cs @@ -126,9 +126,11 @@ public void ApplyCrtFilter() { private void PScreen_Paint(object sender, PaintEventArgs e) { SetPixels(_bC64ScreenBuffer, C64.Vic.ScreenBufferPixels); - _gC64ScreenBuffer.DrawRectangle(_penWhite, (int)C64.Vic.FullFrame.X, (int)C64.Vic.FullFrame.Y, (int)C64.Vic.FullFrame.Width, (int)C64.Vic.FullFrame.Height); - _gC64ScreenBuffer.DrawRectangle(_penWhite, (int)C64.Vic.BorderFrame.X, (int)C64.Vic.BorderFrame.Y, (int)C64.Vic.BorderFrame.Width, (int)C64.Vic.BorderFrame.Height); - _gC64ScreenBuffer.DrawRectangle(_penWhite, (int)C64.Vic.DisplayFrame.X, (int)C64.Vic.DisplayFrame.Y, (int)C64.Vic.DisplayFrame.Width, (int)C64.Vic.DisplayFrame.Height); + if (btnShowVideoFrameOutlines.Checked) { + _gC64ScreenBuffer.DrawRectangle(_penWhite, (int)C64.Vic.FullFrame.X, (int)C64.Vic.FullFrame.Y, (int)C64.Vic.FullFrame.Width, (int)C64.Vic.FullFrame.Height); + _gC64ScreenBuffer.DrawRectangle(_penWhite, (int)C64.Vic.BorderFrame.X, (int)C64.Vic.BorderFrame.Y, (int)C64.Vic.BorderFrame.Width, (int)C64.Vic.BorderFrame.Height); + _gC64ScreenBuffer.DrawRectangle(_penWhite, (int)C64.Vic.DisplayFrame.X, (int)C64.Vic.DisplayFrame.Y, (int)C64.Vic.DisplayFrame.Width, (int)C64.Vic.DisplayFrame.Height); + } var p = C64.Vic.GetScanlinePoint(); _gC64ScreenBuffer.DrawLine(_penWhite, p.X, p.Y, p.X + 8, p.Y); diff --git a/ComputerSystems/Commodore64/FormC64Screen.resx b/ComputerSystems/Commodore64/FormC64Screen.resx index 8495d1e..db0a51f 100644 --- a/ComputerSystems/Commodore64/FormC64Screen.resx +++ b/ComputerSystems/Commodore64/FormC64Screen.resx @@ -138,14 +138,14 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGdSURBVDhPvVLJTgJBFJwP8ApD2MIOw8xA2LcAc9XEX/Du - F3gwGOPFg99hNNEvcYk3bxzUaOJB9KDGKJO2qmlUlOVmJR2G6vfqVb/3tH9FKBTaVJ+zEQgE1mKx2JH6 - O4FWqyUymcyNruumor4RiUR6lUrl2XEc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kJggg== diff --git a/ComputerSystems/Commodore64/Properties/Settings.Designer.cs b/ComputerSystems/Commodore64/Properties/Settings.Designer.cs index 8ad878c..f81f754 100644 --- a/ComputerSystems/Commodore64/Properties/Settings.Designer.cs +++ b/ComputerSystems/Commodore64/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace Commodore64.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -34,5 +34,17 @@ public bool ApplyCrtFilter { this["ApplyCrtFilter"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool ShowVideoFrameOutlines { + get { + return ((bool)(this["ShowVideoFrameOutlines"])); + } + set { + this["ShowVideoFrameOutlines"] = value; + } + } } } diff --git a/ComputerSystems/Commodore64/Properties/Settings.settings b/ComputerSystems/Commodore64/Properties/Settings.settings index 330976e..7a7be9f 100644 --- a/ComputerSystems/Commodore64/Properties/Settings.settings +++ b/ComputerSystems/Commodore64/Properties/Settings.settings @@ -5,5 +5,8 @@ True + + False + \ No newline at end of file