diff --git a/FoenixIDETester/CpuTests.cs b/FoenixIDETester/CpuTests.cs index 22f89c8..864926f 100644 --- a/FoenixIDETester/CpuTests.cs +++ b/FoenixIDETester/CpuTests.cs @@ -384,7 +384,7 @@ public void CheckLargInx() cpu.ExecuteNext(); Assert.AreEqual(2, cpu.X.Width); - + cpu.X.Value = 0xFFFF; Assert.AreEqual(0xFFFF, cpu.X.Value); MemMgr.RAM.WriteByte(cpu.PC, OpcodeList.INX_Implied); @@ -438,7 +438,7 @@ public void CheckContentOfBIsValid() /** * Bug reported by @Minstrel Dragon on Discord * - * I'll perform the test in 6502 mode + * I'll perform the test in 6502 mode - Decimal Subtraction * * sed * sec @@ -448,7 +448,7 @@ public void CheckContentOfBIsValid() * A register should contain #$94 */ [TestMethod] - public void SubstractNegative() + public void SubstractBCDNegative() { ClearCarry(); // SED - switch to decimal @@ -471,8 +471,126 @@ public void SubstractNegative() // The result should be #$94 Assert.AreEqual(0x94, cpu.A.Value); + } + + /** + * Bug reported by @Minstrel Dragon on Discord + * + * I'll perform the test in 6502 mode - Decimal Subtraction + * Need double byte to perform $200 - 1 = $199 + * + */ + [TestMethod] + public void SubstractBCDWord200minus1() + { + ClearCarry(); + // SED - switch to decimal + MemMgr.RAM.WriteByte(cpu.PC, OpcodeList.SED_Implied); + cpu.ExecuteNext(); + + // SEC - set the carry bit + MemMgr.RAM.WriteByte(cpu.PC, OpcodeList.SEC_Implied); + cpu.ExecuteNext(); + + // LDA #0 + MemMgr.RAM.WriteByte(cpu.PC, OpcodeList.LDA_Immediate); + MemMgr.RAM.WriteByte(cpu.PC + 1, 0x0); + cpu.ExecuteNext(); + // SBC #1 + MemMgr.RAM.WriteByte(cpu.PC, OpcodeList.SBC_Immediate); + MemMgr.RAM.WriteByte(cpu.PC + 1, 0x1); + cpu.ExecuteNext(); + + // The result should be #2 + Assert.AreEqual(0x99, cpu.A.Value); + Assert.IsFalse(cpu.Flags.Carry); + + // So the carry should be forwarded to the next SBC operation + // LDA #2 + MemMgr.RAM.WriteByte(cpu.PC, OpcodeList.LDA_Immediate); + MemMgr.RAM.WriteByte(cpu.PC + 1, 0x2); + cpu.ExecuteNext(); + + // SBC #0 + MemMgr.RAM.WriteByte(cpu.PC, OpcodeList.SBC_Immediate); + MemMgr.RAM.WriteByte(cpu.PC + 1, 0x0); + cpu.ExecuteNext(); + // The result should be #2 + Assert.AreEqual(0x1, cpu.A.Value); + } + /** + * Bug reported by @Minstrel Dragon on Discord + * + * I'll perform the test in 6502 mode - Decimal Subtraction + * Need double byte to perform $100 - 1 = $99 + * + */ + [TestMethod] + public void SubstractBCDWord100minus1() + { + ClearCarry(); + // SED - switch to decimal + MemMgr.RAM.WriteByte(cpu.PC, OpcodeList.SED_Implied); + cpu.ExecuteNext(); + + // SEC - set the carry bit + MemMgr.RAM.WriteByte(cpu.PC, OpcodeList.SEC_Implied); + cpu.ExecuteNext(); + + // LDA #0 + MemMgr.RAM.WriteByte(cpu.PC, OpcodeList.LDA_Immediate); + MemMgr.RAM.WriteByte(cpu.PC + 1, 0x0); + cpu.ExecuteNext(); + + // SBC #1 + MemMgr.RAM.WriteByte(cpu.PC, OpcodeList.SBC_Immediate); + MemMgr.RAM.WriteByte(cpu.PC + 1, 0x1); + cpu.ExecuteNext(); + + // The result should be #2 + Assert.AreEqual(0x99, cpu.A.Value); + Assert.IsFalse(cpu.Flags.Carry); + + // So the carry should be forwarded to the next SBC operation + // LDA #1 + MemMgr.RAM.WriteByte(cpu.PC, OpcodeList.LDA_Immediate); + MemMgr.RAM.WriteByte(cpu.PC + 1, 0x1); + cpu.ExecuteNext(); + + // SBC #0 + MemMgr.RAM.WriteByte(cpu.PC, OpcodeList.SBC_Immediate); + MemMgr.RAM.WriteByte(cpu.PC + 1, 0x0); + cpu.ExecuteNext(); + // The result should be #2 + Assert.AreEqual(0x0, cpu.A.Value); } + [TestMethod] + public void SubstractBCD55minus23() + { + ClearCarry(); + // SED - switch to decimal + MemMgr.RAM.WriteByte(cpu.PC, OpcodeList.SED_Implied); + cpu.ExecuteNext(); + + // SEC - set the carry bit + MemMgr.RAM.WriteByte(cpu.PC, OpcodeList.SEC_Implied); + cpu.ExecuteNext(); + + // LDA #55 + MemMgr.RAM.WriteByte(cpu.PC, OpcodeList.LDA_Immediate); + MemMgr.RAM.WriteByte(cpu.PC + 1, 0x55); + cpu.ExecuteNext(); + + // SBC #23 + MemMgr.RAM.WriteByte(cpu.PC, OpcodeList.SBC_Immediate); + MemMgr.RAM.WriteByte(cpu.PC + 1, 0x23); + cpu.ExecuteNext(); + + // The result should be #2 + Assert.AreEqual(0x32, cpu.A.Value); + Assert.IsTrue(cpu.Flags.Carry); + } } } diff --git a/Main/Processor/Operations.cs b/Main/Processor/Operations.cs index ef61551..29ccfc2 100644 --- a/Main/Processor/Operations.cs +++ b/Main/Processor/Operations.cs @@ -1017,16 +1017,24 @@ public void ExecuteSBC(byte instruction, AddressModes addressMode, int signature if (val < cpu.A.Value) { nv = HexVal(BCDVal(cpu.A.Value) - BCDVal(val + 1) + cpu.Flags.CarryBit); + cpu.Flags.Carry = true; // hack! } else { - nv = HexVal(0x64 + BCDVal(cpu.A.Value) - BCDVal(val + 1) + cpu.Flags.CarryBit); + if (cpu.A.Width == 1) + { + nv = HexVal(100 + BCDVal(cpu.A.Value) - BCDVal(val + 1) + cpu.Flags.CarryBit); + } + else + { + nv = HexVal(10000 + BCDVal(cpu.A.Value) - BCDVal(val + 1) + cpu.Flags.CarryBit); + } + cpu.Flags.Carry = false; // hack! } } else { nv = cpu.A.Value - val - 1 + cpu.Flags.CarryBit; - if (cpu.A.Width == 1) { cpu.Flags.oVerflow = ((cpu.A.Value ^ nv) & ((0x100 - val - 1 + cpu.Flags.CarryBit) ^ nv) & 0x80) != 0; @@ -1035,10 +1043,9 @@ public void ExecuteSBC(byte instruction, AddressModes addressMode, int signature { cpu.Flags.oVerflow = ((cpu.A.Value ^ nv) & ((0x10000 - val - 1 + cpu.Flags.CarryBit) ^ nv) & 0x8000) != 0; } + cpu.Flags.Carry = (nv >= 0 && nv <= cpu.A.MaxUnsigned); } - cpu.Flags.Carry = (nv >= 0 && nv <= cpu.A.MaxUnsigned); cpu.Flags.SetNZ(nv, cpu.A.Width); - cpu.A.Value = nv; } diff --git a/Main/Properties/AssemblyInfo.cs b/Main/Properties/AssemblyInfo.cs index edcfadc..6ef66f0 100644 --- a/Main/Properties/AssemblyInfo.cs +++ b/Main/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.7.0.14")] -[assembly: AssemblyFileVersion("0.7.0.14")] +[assembly: AssemblyVersion("0.7.0.15")] +[assembly: AssemblyFileVersion("0.7.0.15")] diff --git a/Main/UI/AssetDialog.cs b/Main/UI/AssetDialog.cs index 2f363f4..1a13721 100644 --- a/Main/UI/AssetDialog.cs +++ b/Main/UI/AssetDialog.cs @@ -96,7 +96,14 @@ private void AssetGrid_CellClick(object sender, DataGridViewCellEventArgs e) FileStream dataFile = File.Create(saveDlg.FileName, 0x800, FileOptions.SequentialScan); byte[] buffer = new byte[res.Length]; - kernel_ref.MemMgr.CopyIntoBuffer(res.StartAddress, res.Length, buffer); + if (res.FileType == ResourceType.lut && kernel_ref.MemMgr.MMU != null) + { + kernel_ref.MemMgr.VICKY.CopyIntoBuffer(res.StartAddress, res.Length, buffer); + } + else + { + kernel_ref.MemMgr.CopyIntoBuffer(res.StartAddress, res.Length, buffer); + } dataFile.Write(buffer, 0, res.Length); dataFile.Close(); diff --git a/Main/UI/AssetLoader.cs b/Main/UI/AssetLoader.cs index 602d30c..b8b5de6 100644 --- a/Main/UI/AssetLoader.cs +++ b/Main/UI/AssetLoader.cs @@ -18,7 +18,6 @@ public partial class AssetLoader : Form public int topLeftPixelColor = 0; private bool isF256; private Display.Gpu GpuRef; - private int F256_LUT_STORE = 0x7_0000; public AssetLoader() { @@ -116,7 +115,16 @@ private void BrowseFileButton_Click(object sender, EventArgs e) FileTypesCombo.SelectedIndex = 6; LUTCombo.SelectedIndex = 0; LUTCombo.Enabled = true; - LoadAddressTextBox.Text = "AF:2000"; + if (isF256) + { + + LoadAddressTextBox.Text = "00:3000"; + } + else + { + LoadAddressTextBox.Text = "AF:2000"; + } + } else if (".tlm".Equals(ExtLabel.Text.ToLower())) { @@ -285,6 +293,27 @@ private void StoreButton_Click(object sender, EventArgs e) } } break; + case ".pal": + // Read the file as raw + byte[] colorData = File.ReadAllBytes(FileNameTextBox.Text); + // Check if there's a resource conflict + res.Length = colorData.Length; + if (ResChecker.Add(res)) + { + if (isF256) + { + MemMgrRef.VICKY.CopyBuffer(colorData, 0, destAddress, colorData.Length); + } + else + { + MemMgrRef.CopyBuffer(colorData, 0, destAddress, colorData.Length); + } + } + else + { + res.Length = -1; + } + break; default: // Read the file as raw byte[] data = File.ReadAllBytes(FileNameTextBox.Text); @@ -549,7 +578,7 @@ private unsafe void ConvertBitmapToRaw(Bitmap bitmap, ResourceChecker.Resource r if (!gray) { // Check if a LUT matching our index is present in the Resources, if so don't do anything. - Resource resLut = ResChecker.Find(ResourceType.lut, isF256? lutBaseAddress + F256_LUT_STORE - 0x3000 : lutBaseAddress + MemoryLocations.MemoryMap.VICKY_BASE_ADDR); + Resource resLut = ResChecker.Find(ResourceType.lut, isF256? lutBaseAddress : lutBaseAddress + MemoryLocations.MemoryMap.VICKY_BASE_ADDR); if (resLut == null) { Resource lutPlaceholder = new Resource @@ -557,7 +586,7 @@ private unsafe void ConvertBitmapToRaw(Bitmap bitmap, ResourceChecker.Resource r Length = 0x400, FileType = ResourceType.lut, Name = "Generated LUT", - StartAddress = isF256 ? lutBaseAddress + F256_LUT_STORE - 0x3000 : lutBaseAddress + MemoryLocations.MemoryMap.VICKY_BASE_ADDR + StartAddress = isF256 ? lutBaseAddress : lutBaseAddress + MemoryLocations.MemoryMap.VICKY_BASE_ADDR }; ResChecker.Add(lutPlaceholder); } diff --git a/Main/UI/CPUWindow.Designer.cs b/Main/UI/CPUWindow.Designer.cs index d9ff7ee..924f0d8 100644 --- a/Main/UI/CPUWindow.Designer.cs +++ b/Main/UI/CPUWindow.Designer.cs @@ -105,18 +105,18 @@ private void InitializeComponent() this.HeaderPanel.Controls.Add(this.RunButton); this.HeaderPanel.Dock = System.Windows.Forms.DockStyle.Top; this.HeaderPanel.Location = new System.Drawing.Point(0, 0); - this.HeaderPanel.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.HeaderPanel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.HeaderPanel.Name = "HeaderPanel"; - this.HeaderPanel.Size = new System.Drawing.Size(1220, 46); + this.HeaderPanel.Size = new System.Drawing.Size(608, 24); this.HeaderPanel.TabIndex = 2; // // BreakpointButton // this.BreakpointButton.Dock = System.Windows.Forms.DockStyle.Left; - this.BreakpointButton.Location = new System.Drawing.Point(764, 0); - this.BreakpointButton.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.BreakpointButton.Location = new System.Drawing.Point(382, 0); + this.BreakpointButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.BreakpointButton.Name = "BreakpointButton"; - this.BreakpointButton.Size = new System.Drawing.Size(152, 46); + this.BreakpointButton.Size = new System.Drawing.Size(76, 24); this.BreakpointButton.TabIndex = 6; this.BreakpointButton.Text = "Breakpoints"; this.BreakpointButton.UseVisualStyleBackColor = true; @@ -125,10 +125,10 @@ private void InitializeComponent() // WatchButton // this.WatchButton.Dock = System.Windows.Forms.DockStyle.Left; - this.WatchButton.Location = new System.Drawing.Point(612, 0); - this.WatchButton.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.WatchButton.Location = new System.Drawing.Point(306, 0); + this.WatchButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.WatchButton.Name = "WatchButton"; - this.WatchButton.Size = new System.Drawing.Size(152, 46); + this.WatchButton.Size = new System.Drawing.Size(76, 24); this.WatchButton.TabIndex = 5; this.WatchButton.Text = "Watch"; this.WatchButton.UseVisualStyleBackColor = true; @@ -137,10 +137,10 @@ private void InitializeComponent() // ResetButton // this.ResetButton.Dock = System.Windows.Forms.DockStyle.Left; - this.ResetButton.Location = new System.Drawing.Point(472, 0); - this.ResetButton.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.ResetButton.Location = new System.Drawing.Point(236, 0); + this.ResetButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.ResetButton.Name = "ResetButton"; - this.ResetButton.Size = new System.Drawing.Size(140, 46); + this.ResetButton.Size = new System.Drawing.Size(70, 24); this.ResetButton.TabIndex = 4; this.ResetButton.Text = "Reset"; this.ResetButton.UseVisualStyleBackColor = true; @@ -149,10 +149,10 @@ private void InitializeComponent() // StepOverButton // this.StepOverButton.Dock = System.Windows.Forms.DockStyle.Left; - this.StepOverButton.Location = new System.Drawing.Point(292, 0); - this.StepOverButton.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.StepOverButton.Location = new System.Drawing.Point(146, 0); + this.StepOverButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.StepOverButton.Name = "StepOverButton"; - this.StepOverButton.Size = new System.Drawing.Size(180, 46); + this.StepOverButton.Size = new System.Drawing.Size(90, 24); this.StepOverButton.TabIndex = 3; this.StepOverButton.Text = "Step Over (F7)"; this.StepOverButton.UseVisualStyleBackColor = true; @@ -161,10 +161,10 @@ private void InitializeComponent() // StepButton // this.StepButton.Dock = System.Windows.Forms.DockStyle.Left; - this.StepButton.Location = new System.Drawing.Point(152, 0); - this.StepButton.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.StepButton.Location = new System.Drawing.Point(76, 0); + this.StepButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.StepButton.Name = "StepButton"; - this.StepButton.Size = new System.Drawing.Size(140, 46); + this.StepButton.Size = new System.Drawing.Size(70, 24); this.StepButton.TabIndex = 2; this.StepButton.Text = "Step (F6)"; this.StepButton.UseVisualStyleBackColor = true; @@ -174,9 +174,9 @@ private void InitializeComponent() // this.RunButton.Dock = System.Windows.Forms.DockStyle.Left; this.RunButton.Location = new System.Drawing.Point(0, 0); - this.RunButton.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.RunButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.RunButton.Name = "RunButton"; - this.RunButton.Size = new System.Drawing.Size(152, 46); + this.RunButton.Size = new System.Drawing.Size(76, 24); this.RunButton.TabIndex = 1; this.RunButton.Tag = "0"; this.RunButton.Text = "Run (F5)"; @@ -186,11 +186,11 @@ private void InitializeComponent() // locationLabel // this.locationLabel.Dock = System.Windows.Forms.DockStyle.Left; - this.locationLabel.Location = new System.Drawing.Point(292, 0); - this.locationLabel.Margin = new System.Windows.Forms.Padding(8, 0, 8, 0); + this.locationLabel.Location = new System.Drawing.Point(146, 0); + this.locationLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.locationLabel.Name = "locationLabel"; - this.locationLabel.Padding = new System.Windows.Forms.Padding(0, 8, 0, 0); - this.locationLabel.Size = new System.Drawing.Size(128, 46); + this.locationLabel.Padding = new System.Windows.Forms.Padding(0, 4, 0, 0); + this.locationLabel.Size = new System.Drawing.Size(64, 24); this.locationLabel.TabIndex = 9; this.locationLabel.Text = "Location $"; // @@ -198,10 +198,10 @@ private void InitializeComponent() // this.locationInput.Dock = System.Windows.Forms.DockStyle.Left; this.locationInput.Font = new System.Drawing.Font("Consolas", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.locationInput.Location = new System.Drawing.Point(420, 0); - this.locationInput.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.locationInput.Location = new System.Drawing.Point(210, 0); + this.locationInput.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.locationInput.Name = "locationInput"; - this.locationInput.Size = new System.Drawing.Size(124, 39); + this.locationInput.Size = new System.Drawing.Size(64, 23); this.locationInput.TabIndex = 10; this.locationInput.Text = "00:0000"; this.locationInput.Validated += new System.EventHandler(this.LocationInput_Validated); @@ -209,10 +209,10 @@ private void InitializeComponent() // JumpButton // this.JumpButton.Dock = System.Windows.Forms.DockStyle.Left; - this.JumpButton.Location = new System.Drawing.Point(152, 0); - this.JumpButton.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.JumpButton.Location = new System.Drawing.Point(76, 0); + this.JumpButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.JumpButton.Name = "JumpButton"; - this.JumpButton.Size = new System.Drawing.Size(140, 46); + this.JumpButton.Size = new System.Drawing.Size(70, 24); this.JumpButton.TabIndex = 10; this.JumpButton.Text = "Jump"; this.JumpButton.UseVisualStyleBackColor = true; @@ -224,11 +224,11 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this.lastLine.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lastLine.Font = new System.Drawing.Font("Consolas", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lastLine.Location = new System.Drawing.Point(2, 888); - this.lastLine.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.lastLine.Location = new System.Drawing.Point(1, 462); + this.lastLine.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.lastLine.Name = "lastLine"; this.lastLine.ReadOnly = true; - this.lastLine.Size = new System.Drawing.Size(1206, 39); + this.lastLine.Size = new System.Drawing.Size(605, 23); this.lastLine.TabIndex = 4; this.lastLine.Text = "Click [Step] to execute an instruction"; this.lastLine.WordWrap = false; @@ -239,12 +239,12 @@ private void InitializeComponent() this.stackText.BackColor = System.Drawing.SystemColors.ControlLightLight; this.stackText.Dock = System.Windows.Forms.DockStyle.Right; this.stackText.Font = new System.Drawing.Font("Consolas", 10F); - this.stackText.Location = new System.Drawing.Point(1220, 0); - this.stackText.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.stackText.Location = new System.Drawing.Point(608, 0); + this.stackText.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.stackText.Multiline = true; this.stackText.Name = "stackText"; this.stackText.ReadOnly = true; - this.stackText.Size = new System.Drawing.Size(296, 901); + this.stackText.Size = new System.Drawing.Size(150, 485); this.stackText.TabIndex = 3; // // UpdateTraceTimer @@ -257,19 +257,19 @@ private void InitializeComponent() this.SecondPanel.Controls.Add(this.locationLabel); this.SecondPanel.Controls.Add(this.JumpButton); this.SecondPanel.Controls.Add(this.ClearTraceButton); - this.SecondPanel.Location = new System.Drawing.Point(0, 48); - this.SecondPanel.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.SecondPanel.Location = new System.Drawing.Point(0, 25); + this.SecondPanel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.SecondPanel.Name = "SecondPanel"; - this.SecondPanel.Size = new System.Drawing.Size(732, 46); + this.SecondPanel.Size = new System.Drawing.Size(366, 24); this.SecondPanel.TabIndex = 5; // // ClearTraceButton // this.ClearTraceButton.Dock = System.Windows.Forms.DockStyle.Left; this.ClearTraceButton.Location = new System.Drawing.Point(0, 0); - this.ClearTraceButton.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.ClearTraceButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.ClearTraceButton.Name = "ClearTraceButton"; - this.ClearTraceButton.Size = new System.Drawing.Size(152, 46); + this.ClearTraceButton.Size = new System.Drawing.Size(76, 24); this.ClearTraceButton.TabIndex = 9; this.ClearTraceButton.Text = "Clear Trace"; this.ClearTraceButton.UseVisualStyleBackColor = true; @@ -280,10 +280,10 @@ private void InitializeComponent() this.AddBPOverlayButton.BackColor = System.Drawing.SystemColors.ActiveCaption; this.AddBPOverlayButton.FlatAppearance.BorderSize = 0; this.AddBPOverlayButton.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.AddBPOverlayButton.Location = new System.Drawing.Point(200, 385); - this.AddBPOverlayButton.Margin = new System.Windows.Forms.Padding(4); + this.AddBPOverlayButton.Location = new System.Drawing.Point(100, 200); + this.AddBPOverlayButton.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.AddBPOverlayButton.Name = "AddBPOverlayButton"; - this.AddBPOverlayButton.Size = new System.Drawing.Size(36, 35); + this.AddBPOverlayButton.Size = new System.Drawing.Size(18, 18); this.AddBPOverlayButton.TabIndex = 7; this.AddBPOverlayButton.TabStop = false; this.AddBPOverlayButton.Text = "+"; @@ -296,10 +296,10 @@ private void InitializeComponent() this.DeleteBPOverlayButton.BackColor = System.Drawing.SystemColors.ActiveCaption; this.DeleteBPOverlayButton.FlatAppearance.BorderSize = 0; this.DeleteBPOverlayButton.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.DeleteBPOverlayButton.Location = new System.Drawing.Point(236, 385); - this.DeleteBPOverlayButton.Margin = new System.Windows.Forms.Padding(4); + this.DeleteBPOverlayButton.Location = new System.Drawing.Point(118, 200); + this.DeleteBPOverlayButton.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.DeleteBPOverlayButton.Name = "DeleteBPOverlayButton"; - this.DeleteBPOverlayButton.Size = new System.Drawing.Size(36, 35); + this.DeleteBPOverlayButton.Size = new System.Drawing.Size(18, 18); this.DeleteBPOverlayButton.TabIndex = 8; this.DeleteBPOverlayButton.TabStop = false; this.DeleteBPOverlayButton.Text = "-"; @@ -312,10 +312,10 @@ private void InitializeComponent() this.InspectOverlayButton.BackColor = System.Drawing.SystemColors.ActiveCaption; this.InspectOverlayButton.FlatAppearance.BorderSize = 0; this.InspectOverlayButton.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.InspectOverlayButton.Location = new System.Drawing.Point(274, 385); - this.InspectOverlayButton.Margin = new System.Windows.Forms.Padding(2); + this.InspectOverlayButton.Location = new System.Drawing.Point(137, 200); + this.InspectOverlayButton.Margin = new System.Windows.Forms.Padding(1, 1, 1, 1); this.InspectOverlayButton.Name = "InspectOverlayButton"; - this.InspectOverlayButton.Size = new System.Drawing.Size(76, 35); + this.InspectOverlayButton.Size = new System.Drawing.Size(38, 18); this.InspectOverlayButton.TabIndex = 9; this.InspectOverlayButton.TabStop = false; this.InspectOverlayButton.Text = "Mem"; @@ -329,10 +329,10 @@ private void InitializeComponent() this.StepOverOverlayButton.FlatAppearance.BorderSize = 0; this.StepOverOverlayButton.FlatStyle = System.Windows.Forms.FlatStyle.System; this.StepOverOverlayButton.Font = new System.Drawing.Font("Arial Narrow", 9.857143F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.StepOverOverlayButton.Location = new System.Drawing.Point(352, 385); - this.StepOverOverlayButton.Margin = new System.Windows.Forms.Padding(2); + this.StepOverOverlayButton.Location = new System.Drawing.Point(176, 200); + this.StepOverOverlayButton.Margin = new System.Windows.Forms.Padding(1, 1, 1, 1); this.StepOverOverlayButton.Name = "StepOverOverlayButton"; - this.StepOverOverlayButton.Size = new System.Drawing.Size(44, 35); + this.StepOverOverlayButton.Size = new System.Drawing.Size(22, 18); this.StepOverOverlayButton.TabIndex = 10; this.StepOverOverlayButton.TabStop = false; this.StepOverOverlayButton.Text = "►"; @@ -349,11 +349,11 @@ private void InitializeComponent() this.HeaderTextbox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.HeaderTextbox.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.HeaderTextbox.ForeColor = System.Drawing.SystemColors.ControlLightLight; - this.HeaderTextbox.Location = new System.Drawing.Point(4, 196); + this.HeaderTextbox.Location = new System.Drawing.Point(2, 102); this.HeaderTextbox.Margin = new System.Windows.Forms.Padding(0); this.HeaderTextbox.Name = "HeaderTextbox"; - this.HeaderTextbox.Padding = new System.Windows.Forms.Padding(4, 6, 4, 4); - this.HeaderTextbox.Size = new System.Drawing.Size(1208, 42); + this.HeaderTextbox.Padding = new System.Windows.Forms.Padding(2, 3, 2, 2); + this.HeaderTextbox.Size = new System.Drawing.Size(604, 22); this.HeaderTextbox.TabIndex = 11; this.HeaderTextbox.UseCompatibleTextRendering = true; this.HeaderTextbox.UseMnemonic = false; @@ -388,10 +388,10 @@ private void InitializeComponent() this.irqPanel.Controls.Add(this.KeyboardCheckBox); this.irqPanel.Controls.Add(this.SOFCheckbox); this.irqPanel.Controls.Add(this.BreakOnIRQCheckBox); - this.irqPanel.Location = new System.Drawing.Point(744, 48); - this.irqPanel.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.irqPanel.Location = new System.Drawing.Point(372, 25); + this.irqPanel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.irqPanel.Name = "irqPanel"; - this.irqPanel.Size = new System.Drawing.Size(452, 142); + this.irqPanel.Size = new System.Drawing.Size(226, 74); this.irqPanel.TabIndex = 12; // // GabeInt1Check @@ -400,10 +400,10 @@ private void InitializeComponent() this.GabeInt1Check.CheckState = System.Windows.Forms.CheckState.Checked; this.GabeInt1Check.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.GabeInt1Check.IsActive = false; - this.GabeInt1Check.Location = new System.Drawing.Point(346, 108); - this.GabeInt1Check.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.GabeInt1Check.Location = new System.Drawing.Point(173, 56); + this.GabeInt1Check.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.GabeInt1Check.Name = "GabeInt1Check"; - this.GabeInt1Check.Size = new System.Drawing.Size(32, 27); + this.GabeInt1Check.Size = new System.Drawing.Size(16, 14); this.GabeInt1Check.TabIndex = 42; this.GabeInt1Check.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.GabeInt1Check.UseVisualStyleBackColor = true; @@ -415,10 +415,10 @@ private void InitializeComponent() this.VDMACheck.CheckState = System.Windows.Forms.CheckState.Checked; this.VDMACheck.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.VDMACheck.IsActive = false; - this.VDMACheck.Location = new System.Drawing.Point(312, 108); - this.VDMACheck.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.VDMACheck.Location = new System.Drawing.Point(156, 56); + this.VDMACheck.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.VDMACheck.Name = "VDMACheck"; - this.VDMACheck.Size = new System.Drawing.Size(32, 27); + this.VDMACheck.Size = new System.Drawing.Size(16, 14); this.VDMACheck.TabIndex = 41; this.VDMACheck.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.VDMACheck.UseVisualStyleBackColor = true; @@ -430,10 +430,10 @@ private void InitializeComponent() this.V2TileColCheck.CheckState = System.Windows.Forms.CheckState.Checked; this.V2TileColCheck.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.V2TileColCheck.IsActive = false; - this.V2TileColCheck.Location = new System.Drawing.Point(278, 108); - this.V2TileColCheck.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.V2TileColCheck.Location = new System.Drawing.Point(139, 56); + this.V2TileColCheck.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.V2TileColCheck.Name = "V2TileColCheck"; - this.V2TileColCheck.Size = new System.Drawing.Size(32, 27); + this.V2TileColCheck.Size = new System.Drawing.Size(16, 14); this.V2TileColCheck.TabIndex = 40; this.V2TileColCheck.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.V2TileColCheck.UseVisualStyleBackColor = true; @@ -445,10 +445,10 @@ private void InitializeComponent() this.GabeInt2Check.CheckState = System.Windows.Forms.CheckState.Checked; this.GabeInt2Check.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.GabeInt2Check.IsActive = false; - this.GabeInt2Check.Location = new System.Drawing.Point(244, 108); - this.GabeInt2Check.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.GabeInt2Check.Location = new System.Drawing.Point(122, 56); + this.GabeInt2Check.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.GabeInt2Check.Name = "GabeInt2Check"; - this.GabeInt2Check.Size = new System.Drawing.Size(32, 27); + this.GabeInt2Check.Size = new System.Drawing.Size(16, 14); this.GabeInt2Check.TabIndex = 39; this.GabeInt2Check.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.GabeInt2Check.UseVisualStyleBackColor = true; @@ -460,10 +460,10 @@ private void InitializeComponent() this.ExtExpCheck.CheckState = System.Windows.Forms.CheckState.Checked; this.ExtExpCheck.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.ExtExpCheck.IsActive = false; - this.ExtExpCheck.Location = new System.Drawing.Point(212, 108); - this.ExtExpCheck.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.ExtExpCheck.Location = new System.Drawing.Point(106, 56); + this.ExtExpCheck.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.ExtExpCheck.Name = "ExtExpCheck"; - this.ExtExpCheck.Size = new System.Drawing.Size(32, 27); + this.ExtExpCheck.Size = new System.Drawing.Size(16, 14); this.ExtExpCheck.TabIndex = 38; this.ExtExpCheck.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.ExtExpCheck.UseVisualStyleBackColor = true; @@ -475,10 +475,10 @@ private void InitializeComponent() this.SDCardInsertCheck.CheckState = System.Windows.Forms.CheckState.Checked; this.SDCardInsertCheck.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.SDCardInsertCheck.IsActive = false; - this.SDCardInsertCheck.Location = new System.Drawing.Point(176, 108); - this.SDCardInsertCheck.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.SDCardInsertCheck.Location = new System.Drawing.Point(88, 56); + this.SDCardInsertCheck.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.SDCardInsertCheck.Name = "SDCardInsertCheck"; - this.SDCardInsertCheck.Size = new System.Drawing.Size(32, 27); + this.SDCardInsertCheck.Size = new System.Drawing.Size(16, 14); this.SDCardInsertCheck.TabIndex = 34; this.SDCardInsertCheck.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.SDCardInsertCheck.UseVisualStyleBackColor = true; @@ -490,10 +490,10 @@ private void InitializeComponent() this.ParallelPortCheck.CheckState = System.Windows.Forms.CheckState.Checked; this.ParallelPortCheck.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.ParallelPortCheck.IsActive = false; - this.ParallelPortCheck.Location = new System.Drawing.Point(212, 75); - this.ParallelPortCheck.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.ParallelPortCheck.Location = new System.Drawing.Point(106, 39); + this.ParallelPortCheck.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.ParallelPortCheck.Name = "ParallelPortCheck"; - this.ParallelPortCheck.Size = new System.Drawing.Size(32, 27); + this.ParallelPortCheck.Size = new System.Drawing.Size(16, 14); this.ParallelPortCheck.TabIndex = 37; this.ParallelPortCheck.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.ParallelPortCheck.UseVisualStyleBackColor = true; @@ -507,10 +507,10 @@ private void InitializeComponent() this.V2BitColCheck.FlatAppearance.BorderSize = 0; this.V2BitColCheck.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.V2BitColCheck.IsActive = false; - this.V2BitColCheck.Location = new System.Drawing.Point(346, 75); - this.V2BitColCheck.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.V2BitColCheck.Location = new System.Drawing.Point(173, 39); + this.V2BitColCheck.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.V2BitColCheck.Name = "V2BitColCheck"; - this.V2BitColCheck.Size = new System.Drawing.Size(32, 27); + this.V2BitColCheck.Size = new System.Drawing.Size(16, 14); this.V2BitColCheck.TabIndex = 36; this.V2BitColCheck.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.V2BitColCheck.UseVisualStyleBackColor = false; @@ -522,10 +522,10 @@ private void InitializeComponent() this.V2SprColCheck.CheckState = System.Windows.Forms.CheckState.Checked; this.V2SprColCheck.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.V2SprColCheck.IsActive = false; - this.V2SprColCheck.Location = new System.Drawing.Point(380, 75); - this.V2SprColCheck.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.V2SprColCheck.Location = new System.Drawing.Point(190, 39); + this.V2SprColCheck.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.V2SprColCheck.Name = "V2SprColCheck"; - this.V2SprColCheck.Size = new System.Drawing.Size(32, 27); + this.V2SprColCheck.Size = new System.Drawing.Size(16, 14); this.V2SprColCheck.TabIndex = 35; this.V2SprColCheck.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.V2SprColCheck.UseVisualStyleBackColor = true; @@ -537,10 +537,10 @@ private void InitializeComponent() this.SDCardCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; this.SDCardCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.SDCardCheckBox.IsActive = false; - this.SDCardCheckBox.Location = new System.Drawing.Point(176, 75); - this.SDCardCheckBox.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.SDCardCheckBox.Location = new System.Drawing.Point(88, 39); + this.SDCardCheckBox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.SDCardCheckBox.Name = "SDCardCheckBox"; - this.SDCardCheckBox.Size = new System.Drawing.Size(32, 27); + this.SDCardCheckBox.Size = new System.Drawing.Size(16, 14); this.SDCardCheckBox.TabIndex = 34; this.SDCardCheckBox.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.SDCardCheckBox.UseVisualStyleBackColor = true; @@ -552,10 +552,10 @@ private void InitializeComponent() this.GabeInt0Check.CheckState = System.Windows.Forms.CheckState.Checked; this.GabeInt0Check.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.GabeInt0Check.IsActive = false; - this.GabeInt0Check.Location = new System.Drawing.Point(380, 108); - this.GabeInt0Check.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.GabeInt0Check.Location = new System.Drawing.Point(190, 56); + this.GabeInt0Check.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.GabeInt0Check.Name = "GabeInt0Check"; - this.GabeInt0Check.Size = new System.Drawing.Size(32, 27); + this.GabeInt0Check.Size = new System.Drawing.Size(16, 14); this.GabeInt0Check.TabIndex = 33; this.GabeInt0Check.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.GabeInt0Check.UseVisualStyleBackColor = true; @@ -567,10 +567,10 @@ private void InitializeComponent() this.OPL3Checkbox.CheckState = System.Windows.Forms.CheckState.Checked; this.OPL3Checkbox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.OPL3Checkbox.IsActive = false; - this.OPL3Checkbox.Location = new System.Drawing.Point(412, 108); - this.OPL3Checkbox.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.OPL3Checkbox.Location = new System.Drawing.Point(206, 56); + this.OPL3Checkbox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.OPL3Checkbox.Name = "OPL3Checkbox"; - this.OPL3Checkbox.Size = new System.Drawing.Size(32, 27); + this.OPL3Checkbox.Size = new System.Drawing.Size(16, 14); this.OPL3Checkbox.TabIndex = 32; this.OPL3Checkbox.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.OPL3Checkbox.UseVisualStyleBackColor = true; @@ -582,10 +582,10 @@ private void InitializeComponent() this.MPU401Checkbox.CheckState = System.Windows.Forms.CheckState.Checked; this.MPU401Checkbox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.MPU401Checkbox.IsActive = false; - this.MPU401Checkbox.Location = new System.Drawing.Point(244, 75); - this.MPU401Checkbox.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.MPU401Checkbox.Location = new System.Drawing.Point(122, 39); + this.MPU401Checkbox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.MPU401Checkbox.Name = "MPU401Checkbox"; - this.MPU401Checkbox.Size = new System.Drawing.Size(32, 27); + this.MPU401Checkbox.Size = new System.Drawing.Size(16, 14); this.MPU401Checkbox.TabIndex = 31; this.MPU401Checkbox.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.MPU401Checkbox.UseVisualStyleBackColor = true; @@ -597,10 +597,10 @@ private void InitializeComponent() this.COM1Checkbox.CheckState = System.Windows.Forms.CheckState.Checked; this.COM1Checkbox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.COM1Checkbox.IsActive = false; - this.COM1Checkbox.Location = new System.Drawing.Point(278, 75); - this.COM1Checkbox.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.COM1Checkbox.Location = new System.Drawing.Point(139, 39); + this.COM1Checkbox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.COM1Checkbox.Name = "COM1Checkbox"; - this.COM1Checkbox.Size = new System.Drawing.Size(32, 27); + this.COM1Checkbox.Size = new System.Drawing.Size(16, 14); this.COM1Checkbox.TabIndex = 30; this.COM1Checkbox.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.COM1Checkbox.UseVisualStyleBackColor = true; @@ -612,10 +612,10 @@ private void InitializeComponent() this.COM2Checkbox.CheckState = System.Windows.Forms.CheckState.Checked; this.COM2Checkbox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.COM2Checkbox.IsActive = false; - this.COM2Checkbox.Location = new System.Drawing.Point(312, 75); - this.COM2Checkbox.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.COM2Checkbox.Location = new System.Drawing.Point(156, 39); + this.COM2Checkbox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.COM2Checkbox.Name = "COM2Checkbox"; - this.COM2Checkbox.Size = new System.Drawing.Size(32, 27); + this.COM2Checkbox.Size = new System.Drawing.Size(16, 14); this.COM2Checkbox.TabIndex = 29; this.COM2Checkbox.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.COM2Checkbox.UseVisualStyleBackColor = true; @@ -627,10 +627,10 @@ private void InitializeComponent() this.FDCCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.FDCCheckbox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.FDCCheckbox.IsActive = false; - this.FDCCheckbox.Location = new System.Drawing.Point(212, 40); - this.FDCCheckbox.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.FDCCheckbox.Location = new System.Drawing.Point(106, 21); + this.FDCCheckbox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.FDCCheckbox.Name = "FDCCheckbox"; - this.FDCCheckbox.Size = new System.Drawing.Size(32, 27); + this.FDCCheckbox.Size = new System.Drawing.Size(16, 14); this.FDCCheckbox.TabIndex = 28; this.FDCCheckbox.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.FDCCheckbox.UseVisualStyleBackColor = true; @@ -642,10 +642,10 @@ private void InitializeComponent() this.MouseCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.MouseCheckbox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.MouseCheckbox.IsActive = false; - this.MouseCheckbox.Location = new System.Drawing.Point(176, 40); - this.MouseCheckbox.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.MouseCheckbox.Location = new System.Drawing.Point(88, 21); + this.MouseCheckbox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.MouseCheckbox.Name = "MouseCheckbox"; - this.MouseCheckbox.Size = new System.Drawing.Size(32, 27); + this.MouseCheckbox.Size = new System.Drawing.Size(16, 14); this.MouseCheckbox.TabIndex = 27; this.MouseCheckbox.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.MouseCheckbox.UseVisualStyleBackColor = true; @@ -657,10 +657,10 @@ private void InitializeComponent() this.RTCCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.RTCCheckbox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.RTCCheckbox.IsActive = false; - this.RTCCheckbox.Location = new System.Drawing.Point(244, 40); - this.RTCCheckbox.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.RTCCheckbox.Location = new System.Drawing.Point(122, 21); + this.RTCCheckbox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.RTCCheckbox.Name = "RTCCheckbox"; - this.RTCCheckbox.Size = new System.Drawing.Size(32, 27); + this.RTCCheckbox.Size = new System.Drawing.Size(16, 14); this.RTCCheckbox.TabIndex = 26; this.RTCCheckbox.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.RTCCheckbox.UseVisualStyleBackColor = true; @@ -672,10 +672,10 @@ private void InitializeComponent() this.TMR2Checkbox.CheckState = System.Windows.Forms.CheckState.Checked; this.TMR2Checkbox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.TMR2Checkbox.IsActive = false; - this.TMR2Checkbox.Location = new System.Drawing.Point(278, 40); - this.TMR2Checkbox.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.TMR2Checkbox.Location = new System.Drawing.Point(139, 21); + this.TMR2Checkbox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.TMR2Checkbox.Name = "TMR2Checkbox"; - this.TMR2Checkbox.Size = new System.Drawing.Size(32, 27); + this.TMR2Checkbox.Size = new System.Drawing.Size(16, 14); this.TMR2Checkbox.TabIndex = 25; this.TMR2Checkbox.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.TMR2Checkbox.UseVisualStyleBackColor = true; @@ -687,10 +687,10 @@ private void InitializeComponent() this.TMR1Checkbox.CheckState = System.Windows.Forms.CheckState.Checked; this.TMR1Checkbox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.TMR1Checkbox.IsActive = false; - this.TMR1Checkbox.Location = new System.Drawing.Point(312, 40); - this.TMR1Checkbox.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.TMR1Checkbox.Location = new System.Drawing.Point(156, 21); + this.TMR1Checkbox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.TMR1Checkbox.Name = "TMR1Checkbox"; - this.TMR1Checkbox.Size = new System.Drawing.Size(32, 27); + this.TMR1Checkbox.Size = new System.Drawing.Size(16, 14); this.TMR1Checkbox.TabIndex = 24; this.TMR1Checkbox.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.TMR1Checkbox.UseVisualStyleBackColor = true; @@ -703,10 +703,10 @@ private void InitializeComponent() this.TMR0Checkbox.FlatAppearance.BorderSize = 0; this.TMR0Checkbox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.TMR0Checkbox.IsActive = false; - this.TMR0Checkbox.Location = new System.Drawing.Point(346, 40); - this.TMR0Checkbox.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.TMR0Checkbox.Location = new System.Drawing.Point(173, 21); + this.TMR0Checkbox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.TMR0Checkbox.Name = "TMR0Checkbox"; - this.TMR0Checkbox.Size = new System.Drawing.Size(32, 27); + this.TMR0Checkbox.Size = new System.Drawing.Size(16, 14); this.TMR0Checkbox.TabIndex = 23; this.TMR0Checkbox.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.TMR0Checkbox.UseVisualStyleBackColor = false; @@ -718,10 +718,10 @@ private void InitializeComponent() this.SOLCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.SOLCheckbox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.SOLCheckbox.IsActive = false; - this.SOLCheckbox.Location = new System.Drawing.Point(380, 40); - this.SOLCheckbox.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.SOLCheckbox.Location = new System.Drawing.Point(190, 21); + this.SOLCheckbox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.SOLCheckbox.Name = "SOLCheckbox"; - this.SOLCheckbox.Size = new System.Drawing.Size(32, 27); + this.SOLCheckbox.Size = new System.Drawing.Size(16, 14); this.SOLCheckbox.TabIndex = 22; this.SOLCheckbox.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.SOLCheckbox.UseVisualStyleBackColor = true; @@ -730,30 +730,30 @@ private void InitializeComponent() // Reg2Label // this.Reg2Label.AutoSize = true; - this.Reg2Label.Location = new System.Drawing.Point(8, 110); - this.Reg2Label.Margin = new System.Windows.Forms.Padding(8, 0, 8, 0); + this.Reg2Label.Location = new System.Drawing.Point(4, 57); + this.Reg2Label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.Reg2Label.Name = "Reg2Label"; - this.Reg2Label.Size = new System.Drawing.Size(111, 25); + this.Reg2Label.Size = new System.Drawing.Size(58, 13); this.Reg2Label.TabIndex = 21; this.Reg2Label.Text = "IRQ Reg 2"; // // Reg1Label // this.Reg1Label.AutoSize = true; - this.Reg1Label.Location = new System.Drawing.Point(8, 75); - this.Reg1Label.Margin = new System.Windows.Forms.Padding(8, 0, 8, 0); + this.Reg1Label.Location = new System.Drawing.Point(4, 39); + this.Reg1Label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.Reg1Label.Name = "Reg1Label"; - this.Reg1Label.Size = new System.Drawing.Size(111, 25); + this.Reg1Label.Size = new System.Drawing.Size(58, 13); this.Reg1Label.TabIndex = 20; this.Reg1Label.Text = "IRQ Reg 1"; // // Reg0Label // this.Reg0Label.AutoSize = true; - this.Reg0Label.Location = new System.Drawing.Point(8, 42); - this.Reg0Label.Margin = new System.Windows.Forms.Padding(8, 0, 8, 0); + this.Reg0Label.Location = new System.Drawing.Point(4, 22); + this.Reg0Label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.Reg0Label.Name = "Reg0Label"; - this.Reg0Label.Size = new System.Drawing.Size(111, 25); + this.Reg0Label.Size = new System.Drawing.Size(58, 13); this.Reg0Label.TabIndex = 19; this.Reg0Label.Text = "IRQ Reg 0"; // @@ -763,10 +763,10 @@ private void InitializeComponent() this.KeyboardCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; this.KeyboardCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.KeyboardCheckBox.IsActive = false; - this.KeyboardCheckBox.Location = new System.Drawing.Point(412, 75); - this.KeyboardCheckBox.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.KeyboardCheckBox.Location = new System.Drawing.Point(206, 39); + this.KeyboardCheckBox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.KeyboardCheckBox.Name = "KeyboardCheckBox"; - this.KeyboardCheckBox.Size = new System.Drawing.Size(32, 27); + this.KeyboardCheckBox.Size = new System.Drawing.Size(16, 14); this.KeyboardCheckBox.TabIndex = 18; this.KeyboardCheckBox.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.KeyboardCheckBox.UseVisualStyleBackColor = true; @@ -778,10 +778,10 @@ private void InitializeComponent() this.SOFCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.SOFCheckbox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.SOFCheckbox.IsActive = false; - this.SOFCheckbox.Location = new System.Drawing.Point(412, 40); - this.SOFCheckbox.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.SOFCheckbox.Location = new System.Drawing.Point(206, 21); + this.SOFCheckbox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.SOFCheckbox.Name = "SOFCheckbox"; - this.SOFCheckbox.Size = new System.Drawing.Size(32, 27); + this.SOFCheckbox.Size = new System.Drawing.Size(16, 14); this.SOFCheckbox.TabIndex = 17; this.SOFCheckbox.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.SOFCheckbox.UseVisualStyleBackColor = true; @@ -793,10 +793,10 @@ private void InitializeComponent() this.BreakOnIRQCheckBox.BackColor = System.Drawing.SystemColors.Control; this.BreakOnIRQCheckBox.Checked = true; this.BreakOnIRQCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.BreakOnIRQCheckBox.Location = new System.Drawing.Point(8, 6); - this.BreakOnIRQCheckBox.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.BreakOnIRQCheckBox.Location = new System.Drawing.Point(4, 3); + this.BreakOnIRQCheckBox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.BreakOnIRQCheckBox.Name = "BreakOnIRQCheckBox"; - this.BreakOnIRQCheckBox.Size = new System.Drawing.Size(172, 29); + this.BreakOnIRQCheckBox.Size = new System.Drawing.Size(91, 17); this.BreakOnIRQCheckBox.TabIndex = 16; this.BreakOnIRQCheckBox.Text = "Break on IRQ"; this.BreakOnIRQCheckBox.UseVisualStyleBackColor = false; @@ -809,18 +809,18 @@ private void InitializeComponent() this.debugWindowCopyToClipboardMenuItem, this.saveSourceToolStripMenuItem}); this.debugWindowContextMenuStrip.Name = "debugWindowContextMenuStrip"; - this.debugWindowContextMenuStrip.Size = new System.Drawing.Size(285, 80); + this.debugWindowContextMenuStrip.Size = new System.Drawing.Size(172, 48); // // debugWindowCopyToClipboardMenuItem // this.debugWindowCopyToClipboardMenuItem.Name = "debugWindowCopyToClipboardMenuItem"; - this.debugWindowCopyToClipboardMenuItem.Size = new System.Drawing.Size(284, 38); + this.debugWindowCopyToClipboardMenuItem.Size = new System.Drawing.Size(171, 22); this.debugWindowCopyToClipboardMenuItem.Text = "Copy to Clipboard"; // // saveSourceToolStripMenuItem // this.saveSourceToolStripMenuItem.Name = "saveSourceToolStripMenuItem"; - this.saveSourceToolStripMenuItem.Size = new System.Drawing.Size(284, 38); + this.saveSourceToolStripMenuItem.Size = new System.Drawing.Size(171, 22); this.saveSourceToolStripMenuItem.Text = "Save Source..."; this.saveSourceToolStripMenuItem.Click += new System.EventHandler(this.saveSourceToolStripMenuItem_Click); // @@ -829,10 +829,10 @@ private void InitializeComponent() this.LabelOverlayButton.BackColor = System.Drawing.SystemColors.ActiveCaption; this.LabelOverlayButton.FlatAppearance.BorderSize = 0; this.LabelOverlayButton.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.LabelOverlayButton.Location = new System.Drawing.Point(396, 385); - this.LabelOverlayButton.Margin = new System.Windows.Forms.Padding(4); + this.LabelOverlayButton.Location = new System.Drawing.Point(198, 200); + this.LabelOverlayButton.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.LabelOverlayButton.Name = "LabelOverlayButton"; - this.LabelOverlayButton.Size = new System.Drawing.Size(36, 35); + this.LabelOverlayButton.Size = new System.Drawing.Size(18, 18); this.LabelOverlayButton.TabIndex = 13; this.LabelOverlayButton.TabStop = false; this.LabelOverlayButton.Text = "L"; @@ -846,10 +846,10 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.DebugPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.DebugPanel.Location = new System.Drawing.Point(0, 242); - this.DebugPanel.Margin = new System.Windows.Forms.Padding(4); + this.DebugPanel.Location = new System.Drawing.Point(0, 126); + this.DebugPanel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.DebugPanel.Name = "DebugPanel"; - this.DebugPanel.Size = new System.Drawing.Size(1210, 640); + this.DebugPanel.Size = new System.Drawing.Size(606, 334); this.DebugPanel.TabIndex = 6; this.DebugPanel.TabStop = false; this.DebugPanel.MouseClick += new System.Windows.Forms.MouseEventHandler(this.DebugPanel_MouseClick); @@ -858,18 +858,18 @@ private void InitializeComponent() // registerDisplay1 // this.registerDisplay1.CPU = null; - this.registerDisplay1.Location = new System.Drawing.Point(4, 96); - this.registerDisplay1.Margin = new System.Windows.Forms.Padding(12, 10, 12, 10); + this.registerDisplay1.Location = new System.Drawing.Point(2, 50); + this.registerDisplay1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5); this.registerDisplay1.Name = "registerDisplay1"; - this.registerDisplay1.Size = new System.Drawing.Size(732, 94); + this.registerDisplay1.Size = new System.Drawing.Size(366, 49); this.registerDisplay1.TabIndex = 0; this.registerDisplay1.MouseEnter += new System.EventHandler(this.DebugPanel_Leave); // // CPUWindow // - this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1516, 901); + this.ClientSize = new System.Drawing.Size(758, 485); this.Controls.Add(this.LabelOverlayButton); this.Controls.Add(this.irqPanel); this.Controls.Add(this.HeaderTextbox); @@ -887,11 +887,11 @@ private void InitializeComponent() this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.KeyPreview = true; this.Location = new System.Drawing.Point(1280, 0); - this.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6); + this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.MaximizeBox = false; - this.MaximumSize = new System.Drawing.Size(2012, 972); + this.MaximumSize = new System.Drawing.Size(1014, 524); this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(1512, 972); + this.MinimumSize = new System.Drawing.Size(764, 524); this.Name = "CPUWindow"; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.Text = "CPU Window"; diff --git a/Main/UI/CPUWindow.cs b/Main/UI/CPUWindow.cs index ff3874b..ad5a67d 100644 --- a/Main/UI/CPUWindow.cs +++ b/Main/UI/CPUWindow.cs @@ -880,10 +880,11 @@ public void ExecuteStep() { IRQPC = kernel.CPU.PC; kernel.CPU.ExecuteNext(); - kernel.CPU.Pins.IRQ = false; nextPC = kernel.CPU.PC; UpdateInterruptCheckboxes(); + Invoke(new nullParamMethod(Refresh)); + kernel.CPU.Pins.IRQ = false; } if (line == null) { @@ -1169,7 +1170,7 @@ private bool InterruptMatchesCheckboxes() ColorCheckBox[] row3 = { OPL3Checkbox, GabeInt0Check, GabeInt1Check, VDMACheck, V2TileColCheck, GabeInt2Check, ExtExpCheck, SDCardInsertCheck }; for (int i = 0; i < 8; i++) { - if (row3[i].Checked && (reg1 & 1 << i) != 0) + if (row3[i].Checked && (reg2 & 1 << i) != 0) { return true; } diff --git a/Main/UI/JoystickForm.Designer.cs b/Main/UI/JoystickForm.Designer.cs index 1ae2344..e2fd943 100644 --- a/Main/UI/JoystickForm.Designer.cs +++ b/Main/UI/JoystickForm.Designer.cs @@ -49,6 +49,7 @@ private void InitializeComponent() this.UpButton.Name = "UpButton"; this.UpButton.Size = new System.Drawing.Size(30, 30); this.UpButton.TabIndex = 0; + this.UpButton.TabStop = false; this.UpButton.Tag = "1"; this.UpButton.UseVisualStyleBackColor = true; this.UpButton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.AllButtonsDown); @@ -66,6 +67,7 @@ private void InitializeComponent() this.DownButton.Name = "DownButton"; this.DownButton.Size = new System.Drawing.Size(30, 30); this.DownButton.TabIndex = 1; + this.DownButton.TabStop = false; this.DownButton.Tag = "2"; this.DownButton.UseVisualStyleBackColor = true; this.DownButton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.AllButtonsDown); @@ -83,6 +85,7 @@ private void InitializeComponent() this.LeftButton.Name = "LeftButton"; this.LeftButton.Size = new System.Drawing.Size(30, 30); this.LeftButton.TabIndex = 2; + this.LeftButton.TabStop = false; this.LeftButton.Tag = "4"; this.LeftButton.UseVisualStyleBackColor = true; this.LeftButton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.AllButtonsDown); @@ -100,6 +103,7 @@ private void InitializeComponent() this.RightButton.Name = "RightButton"; this.RightButton.Size = new System.Drawing.Size(30, 30); this.RightButton.TabIndex = 3; + this.RightButton.TabStop = false; this.RightButton.Tag = "8"; this.RightButton.UseVisualStyleBackColor = true; this.RightButton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.AllButtonsDown); @@ -119,6 +123,7 @@ private void InitializeComponent() this.Fire2Button.Name = "Fire2Button"; this.Fire2Button.Size = new System.Drawing.Size(30, 30); this.Fire2Button.TabIndex = 4; + this.Fire2Button.TabStop = false; this.Fire2Button.Tag = "32"; this.Fire2Button.Text = "B"; this.Fire2Button.UseVisualStyleBackColor = true; @@ -139,6 +144,7 @@ private void InitializeComponent() this.Fire1Button.Name = "Fire1Button"; this.Fire1Button.Size = new System.Drawing.Size(30, 30); this.Fire1Button.TabIndex = 5; + this.Fire1Button.TabStop = false; this.Fire1Button.Tag = "16"; this.Fire1Button.Text = "A"; this.Fire1Button.UseVisualStyleBackColor = true; diff --git a/Main/UI/JoystickForm.cs b/Main/UI/JoystickForm.cs index 10652bd..6bcda23 100644 --- a/Main/UI/JoystickForm.cs +++ b/Main/UI/JoystickForm.cs @@ -12,6 +12,7 @@ public partial class JoystickForm : Form private int portAddress = 0; private int port = 0; private byte NO_BUTTON = 0xDF; + private byte memory = 0xDF; public JoystickForm() { InitializeComponent(); @@ -23,6 +24,7 @@ public void SetGabe(MemoryRAM device, int address, int port) matrix = null; portAddress = address; this.port = port; + Text = port == 0 ? "Joystick A" : "Joystick B"; NO_BUTTON = 0xDF; } @@ -32,18 +34,19 @@ public void SetMatrix(VIARegisters device, int address, int port) matrix = device; portAddress = address; this.port = port; + Text = port == 0 ? "Joystick A" : "Joystick B"; NO_BUTTON = 0x3F; } - private void SendJoystickValue(byte value) + private void SendJoystickValue() { if (gabe != null) { - gabe.WriteByte(portAddress + port, value); + gabe.WriteByte(portAddress + port, memory); } if (matrix != null) { - matrix.JoystickCode((byte)port, value); + matrix.JoystickCode((byte)port, memory); } } @@ -64,63 +67,73 @@ private void JoystickForm_KeyDown(object sender, KeyEventArgs e) { this.Close(); } - byte value = 0; switch (e.KeyCode) { case Keys.A: - value = (byte)(NO_BUTTON ^ 4); // 0xDB; + case Keys.Left: + memory = (byte)(memory & (NO_BUTTON ^ 4)); // 0xDB; LeftButton.BackColor = SystemColors.ControlDark; break; case Keys.S: - value = (byte)(NO_BUTTON ^ 2); // 0xDD; + case Keys.Down: + memory = (byte)(memory & (NO_BUTTON ^ 2)); // 0xDD; DownButton.BackColor = SystemColors.ControlDark; break; case Keys.D: - value = (byte)(NO_BUTTON ^ 8); // 0xD7; + case Keys.Right: + memory = (byte)(memory & (NO_BUTTON ^ 8)); // 0xD7; RightButton.BackColor = SystemColors.ControlDark; break; case Keys.W: - value = (byte)(NO_BUTTON ^ 1); // 0xDE; + case Keys.Up: + memory = (byte)(memory & (NO_BUTTON ^ 1)); // 0xDE; UpButton.BackColor = SystemColors.ControlDark; break; case Keys.Q: - value = (byte)(NO_BUTTON ^ 0x10); // 0xCF; + memory = (byte)(memory & (NO_BUTTON ^ 0x10)); // 0xCF; Fire1Button.BackColor = SystemColors.ControlDark; break; case Keys.E: - value = (byte)(NO_BUTTON ^ 0x20); // 0x5F; + memory = (byte)(memory & (NO_BUTTON ^ 0x20)); // 0x5F; Fire2Button.BackColor = SystemColors.ControlDark; break; } - if (value != 0) - { - SendJoystickValue(value); - } + SendJoystickValue(); } private void JoystickForm_KeyUp(object sender, KeyEventArgs e) { - SendJoystickValue(NO_BUTTON); switch (e.KeyCode) { case Keys.A: + case Keys.Left: + memory |= 4; LeftButton.BackColor = SystemColors.Control; break; case Keys.S: + case Keys.Down: + memory |= 2; DownButton.BackColor = SystemColors.Control; break; case Keys.D: + case Keys.Right: + memory |= 8; RightButton.BackColor = SystemColors.Control; break; case Keys.W: + case Keys.Up: + memory |= 1; UpButton.BackColor = SystemColors.Control; break; case Keys.Q: + memory |= 0x10; Fire1Button.BackColor = SystemColors.Control; break; case Keys.E: + memory |= 0x20; Fire2Button.BackColor = SystemColors.Control; break; } + SendJoystickValue(); } /* @@ -128,15 +141,20 @@ private void JoystickForm_KeyUp(object sender, KeyEventArgs e) */ private void AllButtonsUp(object sender, MouseEventArgs e) { - SendJoystickValue(NO_BUTTON); + if (sender is Control ctrl) + { + int buttonPressed = int.Parse((string)(ctrl.Tag)); + memory = (byte)(memory | buttonPressed); + SendJoystickValue(); + } } private void AllButtonsDown(object sender, MouseEventArgs e) { if (sender is Control ctrl) { int buttonPressed = int.Parse((string)(ctrl.Tag)); - byte value = (byte)(0xFF & ~buttonPressed); - SendJoystickValue(value); + memory = (byte)(memory & ~buttonPressed); + SendJoystickValue(); } } } diff --git a/Main/UI/MainWindow.Designer.cs b/Main/UI/MainWindow.Designer.cs index eb5f3eb..e3bfe41 100644 --- a/Main/UI/MainWindow.Designer.cs +++ b/Main/UI/MainWindow.Designer.cs @@ -102,6 +102,7 @@ private void InitializeComponent() this.resolution_label2_640x400MenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.Tooltip = new System.Windows.Forms.ToolTip(this.components); this.gpu = new FoenixIDE.Display.Gpu(); + this.joystickSimulatorBToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.statusStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); @@ -153,7 +154,7 @@ private void InitializeComponent() // this.revBToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.revBToolStripMenuItem.Name = "revBToolStripMenuItem"; - this.revBToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.revBToolStripMenuItem.Size = new System.Drawing.Size(163, 22); this.revBToolStripMenuItem.Text = "Rev B"; this.revBToolStripMenuItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.revBToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; @@ -162,7 +163,7 @@ private void InitializeComponent() // this.revCToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.revCToolStripMenuItem.Name = "revCToolStripMenuItem"; - this.revCToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.revCToolStripMenuItem.Size = new System.Drawing.Size(163, 22); this.revCToolStripMenuItem.Text = "Rev C"; this.revCToolStripMenuItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.revCToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; @@ -171,7 +172,7 @@ private void InitializeComponent() // this.revUToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.revUToolStripMenuItem.Name = "revUToolStripMenuItem"; - this.revUToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.revUToolStripMenuItem.Size = new System.Drawing.Size(163, 22); this.revUToolStripMenuItem.Text = "Rev U"; this.revUToolStripMenuItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.revUToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; @@ -180,7 +181,7 @@ private void InitializeComponent() // this.revUPlusToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.revUPlusToolStripMenuItem.Name = "revUPlusToolStripMenuItem"; - this.revUPlusToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.revUPlusToolStripMenuItem.Size = new System.Drawing.Size(163, 22); this.revUPlusToolStripMenuItem.Text = "Rev U+"; this.revUPlusToolStripMenuItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.revUPlusToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; @@ -189,7 +190,7 @@ private void InitializeComponent() // this.revJrToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.revJrToolStripMenuItem.Name = "revJrToolStripMenuItem"; - this.revJrToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.revJrToolStripMenuItem.Size = new System.Drawing.Size(163, 22); this.revJrToolStripMenuItem.Text = "Rev Jr"; this.revJrToolStripMenuItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.revJrToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; @@ -198,7 +199,7 @@ private void InitializeComponent() // this.revJr816ToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.revJr816ToolStripMenuItem.Name = "revJr816ToolStripMenuItem"; - this.revJr816ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.revJr816ToolStripMenuItem.Size = new System.Drawing.Size(163, 22); this.revJr816ToolStripMenuItem.Text = "Rev Jr(816)"; this.revJr816ToolStripMenuItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.revJr816ToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; @@ -207,7 +208,7 @@ private void InitializeComponent() // this.revF256KToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.revF256KToolStripMenuItem.Name = "revF256KToolStripMenuItem"; - this.revF256KToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.revF256KToolStripMenuItem.Size = new System.Drawing.Size(163, 22); this.revF256KToolStripMenuItem.Text = "Rev F256K"; this.revF256KToolStripMenuItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.revF256KToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; @@ -216,7 +217,7 @@ private void InitializeComponent() // this.revF256K816ToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.revF256K816ToolStripMenuItem.Name = "revF256K816ToolStripMenuItem"; - this.revF256K816ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.revF256K816ToolStripMenuItem.Size = new System.Drawing.Size(163, 22); this.revF256K816ToolStripMenuItem.Text = "Rev F256K(816)"; // // revF256K2eToolStripMenuItem @@ -378,6 +379,7 @@ private void InitializeComponent() this.tileEditorToolStripMenuItem, this.characterEditorToolStripMenuItem, this.joystickSimulatorToolStripMenuItem, + this.joystickSimulatorBToolStripMenuItem, this.ConvertHexToPGXToolStripMenuItem, this.ConvertBinToPGXToolStripMenuItem, this.convertHexToPGZToolStripMenuItem, @@ -425,7 +427,8 @@ private void InitializeComponent() // this.joystickSimulatorToolStripMenuItem.Name = "joystickSimulatorToolStripMenuItem"; this.joystickSimulatorToolStripMenuItem.Size = new System.Drawing.Size(187, 22); - this.joystickSimulatorToolStripMenuItem.Text = "Joystick Simulator"; + this.joystickSimulatorToolStripMenuItem.Tag = "0"; + this.joystickSimulatorToolStripMenuItem.Text = "Joystick Simulator A"; this.joystickSimulatorToolStripMenuItem.Click += new System.EventHandler(this.JoystickSimulatorToolStripMenuItem_Click); // // ConvertHexToPGXToolStripMenuItem @@ -755,6 +758,14 @@ private void InitializeComponent() this.gpu.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Gpu_MouseMove); this.gpu.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Gpu_MouseUp); // + // joystickSimulatorBToolStripMenuItem + // + this.joystickSimulatorBToolStripMenuItem.Name = "joystickSimulatorBToolStripMenuItem"; + this.joystickSimulatorBToolStripMenuItem.Size = new System.Drawing.Size(187, 22); + this.joystickSimulatorBToolStripMenuItem.Tag = "1"; + this.joystickSimulatorBToolStripMenuItem.Text = "Joystick Simulator B"; + this.joystickSimulatorBToolStripMenuItem.Click += new System.EventHandler(this.JoystickSimulatorToolStripMenuItem_Click); + // // MainWindow // this.AllowDrop = true; @@ -861,6 +872,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem revUToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem revCToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem revBToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem joystickSimulatorBToolStripMenuItem; } } diff --git a/Main/UI/MainWindow.cs b/Main/UI/MainWindow.cs index bbe8fa0..ac5b573 100644 --- a/Main/UI/MainWindow.cs +++ b/Main/UI/MainWindow.cs @@ -30,7 +30,8 @@ public partial class MainWindow : Form private TileEditor tileEditor; private CharEditorWindow charEditor; public SerialTerminal terminal; - private JoystickForm joystickWindow = new JoystickForm(); + private JoystickForm joystickWindowA = new JoystickForm(); + private JoystickForm joystickWindowB = new JoystickForm(); // Local variables and events private byte previousGraphicMode; @@ -239,7 +240,8 @@ private void BasicWindow_Load(object sender, EventArgs e) String fontPath = Path.Combine(applicationDirectory, "Resources", "Bm437_PhoenixEGA_8x8.bin"); gpu.LoadFontSet("Foenix", fontPath, 0, CharacterSet.CharTypeCodes.ASCII_PET, CharacterSet.SizeCodes.Size8x8); - joystickWindow.SetGabe(kernel.MemMgr.GABE, MemoryLocations.MemoryMap.JOYSTICK0 - MemoryLocations.MemoryMap.GABE_START, 0); + joystickWindowA.SetGabe(kernel.MemMgr.GABE, MemoryLocations.MemoryMap.JOYSTICK0 - MemoryLocations.MemoryMap.GABE_START, 0); + joystickWindowB.SetGabe(kernel.MemMgr.GABE, MemoryLocations.MemoryMap.JOYSTICK1 - MemoryLocations.MemoryMap.GABE_START, 1); gpu.SetMCRAddress(0); gpu.SetFGLUTAddress(MemoryMap.FG_CHAR_LUT_PTR - gpu.VICKY.StartAddress); @@ -270,7 +272,8 @@ private void BasicWindow_Load(object sender, EventArgs e) gpu.VRAM = kernel.MemMgr.RAM; // VIA Chip Port B is joystick 1 - joystickWindow.SetMatrix(kernel.MemMgr.VIAREGISTERS, 0, 0); + joystickWindowA.SetMatrix(kernel.MemMgr.VIAREGISTERS, 0, 0); + joystickWindowB.SetMatrix(kernel.MemMgr.VIAREGISTERS, 0, 1); // see if this a Flat (65c816) Memory space or with MMU if (BoardVersionHelpers.IsF256_Flat(version)) @@ -1872,7 +1875,14 @@ public void UpdateHiRes(bool hires) private void JoystickSimulatorToolStripMenuItem_Click(object sender, EventArgs e) { - joystickWindow.Show(); + if (((ToolStripMenuItem)sender).Tag.Equals("0")) + { + joystickWindowA.Show(); + } + else + { + joystickWindowB.Show(); + } } private void MainWindow_DragEnter(object sender, DragEventArgs e) diff --git a/Main/UI/TileEditor.cs b/Main/UI/TileEditor.cs index ebb3660..3b29f4f 100644 --- a/Main/UI/TileEditor.cs +++ b/Main/UI/TileEditor.cs @@ -415,7 +415,16 @@ private void TilesetAddress_TextChanged(object sender, EventArgs e) } if (offsetAddress > -1) { - MemMgr.WriteLong(tilesetBaseAddr, offsetAddress); + if (is_F256_MMU) + { + MemMgr.VICKY.WriteByte(tilesetBaseAddr + 2, (byte)((offsetAddress & 0xFF_0000) >> 16)); + MemMgr.VICKY.WriteByte(tilesetBaseAddr + 1, (byte)((offsetAddress & 0x00_FF00) >> 8)); + MemMgr.VICKY.WriteByte(tilesetBaseAddr, (byte)((offsetAddress & 0x00_00FF))); + } + else + { + MemMgr.WriteLong(tilesetBaseAddr, offsetAddress); + } } } diff --git a/Release Notes.txt b/Release Notes.txt index a72a90c..15fe30b 100644 --- a/Release Notes.txt +++ b/Release Notes.txt @@ -1,10 +1,11 @@ -Release 0.7.0.14 +Release 0.7.0.15 ---------------- -Added loading of 16x16 and 8x8 sprites in asset loader. -Fixed a bug with sprites not shown when posY >= height - spriteSize or posX >= width - spriteSize. -Fixed issue with WindowX and large tiles. Also fixed the off by 1 issue with small tiles. -When resetting the machine, reset the tilestride... -Fixed SBC (substraction) bug when in decimal mode and the subtrahend is larger than the minuend (difference is negative). +Fixed issues with TileEditor not writing to the tileset address. +Fixed asset loader issues with palettes in F256 mode. +Added second joystick - now A and B are available from menu. +Fixed issue with virtual joystick not accepting multiple buttons/key states. +Fixed issue with CPU window breaking for incorrect IRQ. +Second attempt at fixing BCD subtractions. The carry flag wasn't correct before. ** TODO: Users can now modify the CPU registers when in debug mode. The registers have a white background when editable. ** TODO: Implemented the various cursor modes and rates. @@ -16,7 +17,15 @@ Fixed SBC (substraction) bug when in decimal mode and the subtrahend is larger t ** TODO: Add remote debugging capability for Calypsi compiler. ** TODO: Try to sort out the issue with the character sets in non-unicode installation. ** TODO: Saving basic files to emulated SD card often doesn't work or crashes the emulator. -** TODO: Support two joysticks and allow for multiple joystick buttons + +Release 0.7.0.14 +---------------- +Added loading of 16x16 and 8x8 sprites in asset loader. +Fixed a bug with sprites not shown when posY >= height - spriteSize or posX >= width - spriteSize. +Fixed issue with WindowX and large tiles. Also fixed the off by 1 issue with small tiles. +When resetting the machine, reset the tilestride... +Fixed SBC (substraction) bug when in decimal mode and the subtrahend is larger than the minuend (difference is negative). + Release 0.7.0.13 ----------------