ZXHawk: Fix core GUI windows monospace weirdness

This commit is contained in:
Asnivor 2018-09-18 10:50:15 +01:00
parent 95a68d1497
commit f62ab685a9
9 changed files with 129 additions and 80 deletions

View File

@ -49,7 +49,7 @@
// OkBtn
//
this.OkBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.OkBtn.Location = new System.Drawing.Point(247, 298);
this.OkBtn.Location = new System.Drawing.Point(303, 298);
this.OkBtn.Name = "OkBtn";
this.OkBtn.Size = new System.Drawing.Size(60, 23);
this.OkBtn.TabIndex = 3;
@ -61,7 +61,7 @@
//
this.CancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.CancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CancelBtn.Location = new System.Drawing.Point(313, 298);
this.CancelBtn.Location = new System.Drawing.Point(369, 298);
this.CancelBtn.Name = "CancelBtn";
this.CancelBtn.Size = new System.Drawing.Size(60, 23);
this.CancelBtn.TabIndex = 4;
@ -100,10 +100,10 @@
//
// lblBorderInfo
//
this.lblBorderInfo.Font = new System.Drawing.Font("Lucida Console", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblBorderInfo.Location = new System.Drawing.Point(175, 245);
this.lblBorderInfo.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblBorderInfo.Location = new System.Drawing.Point(175, 236);
this.lblBorderInfo.Name = "lblBorderInfo";
this.lblBorderInfo.Size = new System.Drawing.Size(196, 37);
this.lblBorderInfo.Size = new System.Drawing.Size(254, 59);
this.lblBorderInfo.TabIndex = 24;
this.lblBorderInfo.Text = "Selects a particular panning configuration for the 3ch AY-3-8912 Programmable Sou" +
"nd Generator (128K models only)";
@ -114,7 +114,7 @@
this.tapeVolumetrackBar.Location = new System.Drawing.Point(12, 60);
this.tapeVolumetrackBar.Maximum = 100;
this.tapeVolumetrackBar.Name = "tapeVolumetrackBar";
this.tapeVolumetrackBar.Size = new System.Drawing.Size(359, 45);
this.tapeVolumetrackBar.Size = new System.Drawing.Size(417, 45);
this.tapeVolumetrackBar.TabIndex = 25;
//
// label3
@ -140,7 +140,7 @@
this.earVolumetrackBar.Location = new System.Drawing.Point(12, 124);
this.earVolumetrackBar.Maximum = 100;
this.earVolumetrackBar.Name = "earVolumetrackBar";
this.earVolumetrackBar.Size = new System.Drawing.Size(359, 45);
this.earVolumetrackBar.Size = new System.Drawing.Size(417, 45);
this.earVolumetrackBar.TabIndex = 27;
//
// label5
@ -157,7 +157,7 @@
this.ayVolumetrackBar.Location = new System.Drawing.Point(12, 188);
this.ayVolumetrackBar.Maximum = 100;
this.ayVolumetrackBar.Name = "ayVolumetrackBar";
this.ayVolumetrackBar.Size = new System.Drawing.Size(359, 45);
this.ayVolumetrackBar.Size = new System.Drawing.Size(417, 45);
this.ayVolumetrackBar.TabIndex = 29;
//
// ZXSpectrumAudioSettings
@ -166,7 +166,7 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.CancelBtn;
this.ClientSize = new System.Drawing.Size(385, 333);
this.ClientSize = new System.Drawing.Size(441, 333);
this.Controls.Add(this.label5);
this.Controls.Add(this.ayVolumetrackBar);
this.Controls.Add(this.label4);
@ -179,6 +179,7 @@
this.Controls.Add(this.label1);
this.Controls.Add(this.CancelBtn);
this.Controls.Add(this.OkBtn);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "ZXSpectrumAudioSettings";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;

View File

@ -34,19 +34,19 @@
this.label4 = new System.Windows.Forms.Label();
this.MachineSelectionComboBox = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.lblMachineNotes = new System.Windows.Forms.Label();
this.determEmucheckBox1 = new System.Windows.Forms.CheckBox();
this.label2 = new System.Windows.Forms.Label();
this.borderTypecomboBox1 = new System.Windows.Forms.ComboBox();
this.lblBorderInfo = new System.Windows.Forms.Label();
this.lblAutoLoadText = new System.Windows.Forms.Label();
this.autoLoadcheckBox1 = new System.Windows.Forms.CheckBox();
this.textBoxCoreDetails = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// OkBtn
//
this.OkBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.OkBtn.Location = new System.Drawing.Point(247, 434);
this.OkBtn.Location = new System.Drawing.Point(310, 434);
this.OkBtn.Name = "OkBtn";
this.OkBtn.Size = new System.Drawing.Size(60, 23);
this.OkBtn.TabIndex = 3;
@ -58,7 +58,7 @@
//
this.CancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.CancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CancelBtn.Location = new System.Drawing.Point(313, 434);
this.CancelBtn.Location = new System.Drawing.Point(376, 434);
this.CancelBtn.Name = "CancelBtn";
this.CancelBtn.Size = new System.Drawing.Size(60, 23);
this.CancelBtn.TabIndex = 4;
@ -83,7 +83,7 @@
this.MachineSelectionComboBox.FormattingEnabled = true;
this.MachineSelectionComboBox.Location = new System.Drawing.Point(12, 62);
this.MachineSelectionComboBox.Name = "MachineSelectionComboBox";
this.MachineSelectionComboBox.Size = new System.Drawing.Size(361, 21);
this.MachineSelectionComboBox.Size = new System.Drawing.Size(424, 21);
this.MachineSelectionComboBox.TabIndex = 13;
this.MachineSelectionComboBox.SelectionChangeCommitted += new System.EventHandler(this.MachineSelectionComboBox_SelectionChangeCommitted);
//
@ -96,15 +96,6 @@
this.label1.TabIndex = 17;
this.label1.Text = "ZX Spectrum Emulation Settings";
//
// lblMachineNotes
//
this.lblMachineNotes.Font = new System.Drawing.Font("Lucida Console", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblMachineNotes.Location = new System.Drawing.Point(15, 95);
this.lblMachineNotes.Name = "lblMachineNotes";
this.lblMachineNotes.Size = new System.Drawing.Size(358, 204);
this.lblMachineNotes.TabIndex = 20;
this.lblMachineNotes.Text = "null\r\n";
//
// determEmucheckBox1
//
this.determEmucheckBox1.AutoSize = true;
@ -132,26 +123,26 @@
this.borderTypecomboBox1.FormattingEnabled = true;
this.borderTypecomboBox1.Location = new System.Drawing.Point(12, 351);
this.borderTypecomboBox1.Name = "borderTypecomboBox1";
this.borderTypecomboBox1.Size = new System.Drawing.Size(157, 21);
this.borderTypecomboBox1.Size = new System.Drawing.Size(220, 21);
this.borderTypecomboBox1.TabIndex = 22;
this.borderTypecomboBox1.SelectedIndexChanged += new System.EventHandler(this.borderTypecomboBox1_SelectedIndexChanged);
//
// lblBorderInfo
//
this.lblBorderInfo.Font = new System.Drawing.Font("Lucida Console", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblBorderInfo.Location = new System.Drawing.Point(175, 351);
this.lblBorderInfo.Font = new System.Drawing.Font("Courier New", 8F);
this.lblBorderInfo.Location = new System.Drawing.Point(240, 335);
this.lblBorderInfo.Name = "lblBorderInfo";
this.lblBorderInfo.Size = new System.Drawing.Size(196, 21);
this.lblBorderInfo.Size = new System.Drawing.Size(196, 53);
this.lblBorderInfo.TabIndex = 24;
this.lblBorderInfo.Text = "null";
this.lblBorderInfo.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lblAutoLoadText
//
this.lblAutoLoadText.Font = new System.Drawing.Font("Lucida Console", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblAutoLoadText.Location = new System.Drawing.Point(175, 388);
this.lblAutoLoadText.Font = new System.Drawing.Font("Courier New", 8F);
this.lblAutoLoadText.Location = new System.Drawing.Point(124, 388);
this.lblAutoLoadText.Name = "lblAutoLoadText";
this.lblAutoLoadText.Size = new System.Drawing.Size(196, 30);
this.lblAutoLoadText.Size = new System.Drawing.Size(312, 43);
this.lblAutoLoadText.TabIndex = 27;
this.lblAutoLoadText.Text = "When enabled ZXHawk will attempt to control the tape device automatically when th" +
"e correct traps are detected";
@ -167,25 +158,39 @@
this.autoLoadcheckBox1.Text = "Auto-Load Tape";
this.autoLoadcheckBox1.UseVisualStyleBackColor = true;
//
// textBoxCoreDetails
//
this.textBoxCoreDetails.AcceptsReturn = true;
this.textBoxCoreDetails.AcceptsTab = true;
this.textBoxCoreDetails.Font = new System.Drawing.Font("Courier New", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxCoreDetails.Location = new System.Drawing.Point(12, 90);
this.textBoxCoreDetails.Multiline = true;
this.textBoxCoreDetails.Name = "textBoxCoreDetails";
this.textBoxCoreDetails.ReadOnly = true;
this.textBoxCoreDetails.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBoxCoreDetails.Size = new System.Drawing.Size(424, 206);
this.textBoxCoreDetails.TabIndex = 28;
//
// ZXSpectrumCoreEmulationSettings
//
this.AcceptButton = this.OkBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.CancelBtn;
this.ClientSize = new System.Drawing.Size(385, 469);
this.ClientSize = new System.Drawing.Size(448, 469);
this.Controls.Add(this.textBoxCoreDetails);
this.Controls.Add(this.lblAutoLoadText);
this.Controls.Add(this.autoLoadcheckBox1);
this.Controls.Add(this.lblBorderInfo);
this.Controls.Add(this.label2);
this.Controls.Add(this.borderTypecomboBox1);
this.Controls.Add(this.determEmucheckBox1);
this.Controls.Add(this.lblMachineNotes);
this.Controls.Add(this.label1);
this.Controls.Add(this.label4);
this.Controls.Add(this.MachineSelectionComboBox);
this.Controls.Add(this.CancelBtn);
this.Controls.Add(this.OkBtn);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "ZXSpectrumCoreEmulationSettings";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
@ -203,12 +208,12 @@
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ComboBox MachineSelectionComboBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lblMachineNotes;
private System.Windows.Forms.CheckBox determEmucheckBox1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox borderTypecomboBox1;
private System.Windows.Forms.Label lblBorderInfo;
private System.Windows.Forms.Label lblAutoLoadText;
private System.Windows.Forms.CheckBox autoLoadcheckBox1;
private System.Windows.Forms.TextBox textBoxCoreDetails;
}
}

View File

@ -88,7 +88,7 @@ namespace BizHawk.Client.EmuHawk
private void UpdateMachineNotes(MachineType type)
{
lblMachineNotes.Text = ZXMachineMetaData.GetMetaString(type);
textBoxCoreDetails.Text = ZXMachineMetaData.GetMetaString(type);
}
private void borderTypecomboBox1_SelectedIndexChanged(object sender, EventArgs e)

View File

@ -158,6 +158,7 @@
this.Controls.Add(this.Port1ComboBox);
this.Controls.Add(this.CancelBtn);
this.Controls.Add(this.OkBtn);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "ZXSpectrumJoystickSettings";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;

View File

@ -43,7 +43,7 @@
// OkBtn
//
this.OkBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.OkBtn.Location = new System.Drawing.Point(247, 142);
this.OkBtn.Location = new System.Drawing.Point(247, 160);
this.OkBtn.Name = "OkBtn";
this.OkBtn.Size = new System.Drawing.Size(60, 23);
this.OkBtn.TabIndex = 3;
@ -55,7 +55,7 @@
//
this.CancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.CancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CancelBtn.Location = new System.Drawing.Point(313, 142);
this.CancelBtn.Location = new System.Drawing.Point(313, 160);
this.CancelBtn.Name = "CancelBtn";
this.CancelBtn.Size = new System.Drawing.Size(60, 23);
this.CancelBtn.TabIndex = 4;
@ -74,10 +74,10 @@
//
// lblOSDVerbinfo
//
this.lblOSDVerbinfo.Font = new System.Drawing.Font("Lucida Console", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblOSDVerbinfo.Location = new System.Drawing.Point(175, 117);
this.lblOSDVerbinfo.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblOSDVerbinfo.Location = new System.Drawing.Point(175, 89);
this.lblOSDVerbinfo.Name = "lblOSDVerbinfo";
this.lblOSDVerbinfo.Size = new System.Drawing.Size(196, 21);
this.lblOSDVerbinfo.Size = new System.Drawing.Size(196, 68);
this.lblOSDVerbinfo.TabIndex = 28;
this.lblOSDVerbinfo.Text = "null";
this.lblOSDVerbinfo.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@ -138,7 +138,7 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.CancelBtn;
this.ClientSize = new System.Drawing.Size(385, 177);
this.ClientSize = new System.Drawing.Size(385, 195);
this.Controls.Add(this.checkBoxShowCoreBrdColor);
this.Controls.Add(this.buttonChooseBGColor);
this.Controls.Add(this.label2);
@ -148,6 +148,7 @@
this.Controls.Add(this.label1);
this.Controls.Add(this.CancelBtn);
this.Controls.Add(this.OkBtn);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "ZXSpectrumNonSyncSettings";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;

View File

@ -139,11 +139,11 @@
this.Controls.Add(this.label1);
this.Controls.Add(this.CancelBtn);
this.Controls.Add(this.OkBtn);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "ZXSpectrumPokeMemory";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Poke Memory";
((System.ComponentModel.ISupportInitialize)(this.numericUpDownAddress)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownByte)).EndInit();
this.ResumeLayout(false);

View File

@ -49,7 +49,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
Regs[dest] = ReadHardware((ushort)(Regs[src_l] | (Regs[src_h]) << 8));
Regs[DB] = Regs[dest];
FlagZ = Regs[dest] == 0;
//FlagZ = Regs[dest] == 0;
FlagP = TableParity[Regs[dest]];
FlagH = false;
FlagN = false;

View File

@ -1,5 +1,7 @@
using BizHawk.Common;
using BizHawk.Emulation.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
@ -238,6 +240,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
public string Media { get; set; }
public string OtherMisc { get; set; }
Dictionary<string, string> Data = new Dictionary<string, string>();
public static ZXMachineMetaData GetMetaObject(MachineType type)
{
@ -318,6 +321,16 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
m.Media = "3\" Floppy Disk (via built-in Floppy Drive)";
break;
}
m.Data.Add(ZXSpectrum.GetMemberName((ZXMachineMetaData c) => c.Name), m.Name.Trim());
m.Data.Add(ZXSpectrum.GetMemberName((ZXMachineMetaData c) => c.Description), m.Description.Trim());
m.Data.Add(ZXSpectrum.GetMemberName((ZXMachineMetaData c) => c.Released), m.Released.Trim());
m.Data.Add(ZXSpectrum.GetMemberName((ZXMachineMetaData c) => c.CPU), m.CPU.Trim());
m.Data.Add(ZXSpectrum.GetMemberName((ZXMachineMetaData c) => c.Memory), m.Memory.Trim());
m.Data.Add(ZXSpectrum.GetMemberName((ZXMachineMetaData c) => c.Video), m.Video.Trim());
m.Data.Add(ZXSpectrum.GetMemberName((ZXMachineMetaData c) => c.Audio), m.Audio.Trim());
m.Data.Add(ZXSpectrum.GetMemberName((ZXMachineMetaData c) => c.Media), m.Media.Trim());
return m;
}
@ -327,48 +340,70 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
StringBuilder sb = new StringBuilder();
sb.Append(m.Name);
sb.Append("\n");
sb.Append("-----------------------------------------------------------------\n");
// Release
sb.Append("Released:");
sb.Append(" ");
sb.Append(m.Released);
sb.Append("\n");
// CPU
sb.Append("CPU:");
sb.Append(" ");
sb.Append(m.CPU);
sb.Append("\n");
// Memory
sb.Append("Memory:");
sb.Append(" ");
sb.Append(m.Memory);
sb.Append("\n");
// Video
sb.Append("Video:");
sb.Append(" ");
sb.Append(m.Video);
sb.Append("\n");
// Audio
sb.Append("Audio:");
sb.Append(" ");
sb.Append(m.Audio);
sb.Append("\n");
// Audio
sb.Append("Media:");
sb.Append(" ");
sb.Append(m.Media);
sb.Append("\n");
// get longest title
int titleLen = 0;
foreach (var d in m.Data)
{
if (d.Key.Length > titleLen)
titleLen = d.Key.Length;
}
sb.Append("-----------------------------------------------------------------\n");
// description
sb.Append(m.Description);
if (m.OtherMisc != null)
sb.Append("\n" + m.OtherMisc);
var maxDataLineLen = 40;
// generate layout
foreach (var d in m.Data)
{
var tLen = d.Key.Length;
var makeup = (titleLen - tLen) / 4;
sb.Append(d.Key + ":\t");
for (int i = 0; i < makeup; i++)
{
if (tLen > 4)
sb.Append("\t");
else
{
makeup--;
sb.Append("\t");
}
}
// output the data splitting and tabbing as neccessary
var arr = d.Value.Split(' ');
int cnt = 0;
List<string> builder = new List<string>();
string working = "";
foreach (var s in arr)
{
var len = s.Length;
if (working.Length + 1 + len > maxDataLineLen)
{
// new line needed
builder.Add(working.Trim(' '));
working = "";
}
working += s + " ";
}
builder.Add(working.Trim(' '));
// output the data
for (int i = 0; i < builder.Count; i++)
{
if (i != 0)
{
sb.Append("\t");
sb.Append("\t");
}
sb.Append(builder[i]);
sb.Append("\r\n");
}
//sb.Append("\r\n");
}
return sb.ToString();
}
}
}

View File

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Linq.Expressions;
namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
{
@ -68,5 +69,10 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
return SZX.ExportSZX(_machine);
//return System.Text.Encoding.Default.GetString(data);
}
public static string GetMemberName<T, TValue>(Expression<Func<T, TValue>> memberAccess)
{
return ((MemberExpression)memberAccess.Body).Member.Name;
}
}
}