mirror of
https://github.com/livingcomputermuseum/Darkstar.git
synced 2026-04-25 20:01:44 +00:00
Some useful improvements/changes to Darkstar
new functionality - ethernet: new network device for direct connection to a Dodo NetHub (instead of going through a real network device) - configuration-dialog: extensions for selecting and configuring the NetHub connection - command-line: new optional parameter "-start" for starting the emulator when the UI is ready - configuration-file: added new parameters to match the items that can be specified through the UI, also to autostart the system new entries: NetHubHost, NetHubPort, AltBootMode, Start (see the sample config-file in star_os_5.0.zip for all options) changes/fixes: - development: use of SharpDevelop with .net 4.5 - ethernet: add 2 extra zero-words to prevent packets larger than 56 bytes from being ignored by the ethernet microcode - configuration-dialog: allow to specify 48 bit machine-ids (only 40 significant bits were accepted so far) - display: reversed the order of the pattern lines to match the background pattern in the main display area
This commit is contained in:
83
D/UI/ConfigurationDialog.Designer.cs
generated
83
D/UI/ConfigurationDialog.Designer.cs
generated
@@ -68,6 +68,7 @@ namespace D.UI
|
||||
this.EthernetInterfaceListBox = new System.Windows.Forms.ListBox();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.DisplayTab = new System.Windows.Forms.TabPage();
|
||||
this.FullScreenStretchCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.DisplayScaleComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.SlowPhosphorCheckBox = new System.Windows.Forms.CheckBox();
|
||||
@@ -82,12 +83,16 @@ namespace D.UI
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.OKButton = new System.Windows.Forms.Button();
|
||||
this.Cancel_Button = new System.Windows.Forms.Button();
|
||||
this.FullScreenStretchCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.lblNetHubHost = new System.Windows.Forms.Label();
|
||||
this.txtNetHubHost = new System.Windows.Forms.TextBox();
|
||||
this.numNetHubPort = new System.Windows.Forms.NumericUpDown();
|
||||
this.lblNetHubPort = new System.Windows.Forms.Label();
|
||||
this.TabControl.SuspendLayout();
|
||||
this.SystemPage.SuspendLayout();
|
||||
this.EthernetTab.SuspendLayout();
|
||||
this.DisplayTab.SuspendLayout();
|
||||
this.TimeTabPage.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numNetHubPort)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// TabControl
|
||||
@@ -171,6 +176,10 @@ namespace D.UI
|
||||
//
|
||||
// EthernetTab
|
||||
//
|
||||
this.EthernetTab.Controls.Add(this.lblNetHubPort);
|
||||
this.EthernetTab.Controls.Add(this.numNetHubPort);
|
||||
this.EthernetTab.Controls.Add(this.txtNetHubHost);
|
||||
this.EthernetTab.Controls.Add(this.lblNetHubHost);
|
||||
this.EthernetTab.Controls.Add(this.EthernetInterfaceListBox);
|
||||
this.EthernetTab.Controls.Add(this.label5);
|
||||
this.EthernetTab.Location = new System.Drawing.Point(4, 22);
|
||||
@@ -186,8 +195,9 @@ namespace D.UI
|
||||
this.EthernetInterfaceListBox.FormattingEnabled = true;
|
||||
this.EthernetInterfaceListBox.Location = new System.Drawing.Point(10, 24);
|
||||
this.EthernetInterfaceListBox.Name = "EthernetInterfaceListBox";
|
||||
this.EthernetInterfaceListBox.Size = new System.Drawing.Size(332, 134);
|
||||
this.EthernetInterfaceListBox.Size = new System.Drawing.Size(332, 121);
|
||||
this.EthernetInterfaceListBox.TabIndex = 1;
|
||||
this.EthernetInterfaceListBox.SelectedValueChanged += new System.EventHandler(this.OnEthernetInterfaceChanged);
|
||||
//
|
||||
// label5
|
||||
//
|
||||
@@ -212,6 +222,16 @@ namespace D.UI
|
||||
this.DisplayTab.Text = "Display";
|
||||
this.DisplayTab.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// FullScreenStretchCheckBox
|
||||
//
|
||||
this.FullScreenStretchCheckBox.AutoSize = true;
|
||||
this.FullScreenStretchCheckBox.Location = new System.Drawing.Point(6, 55);
|
||||
this.FullScreenStretchCheckBox.Name = "FullScreenStretchCheckBox";
|
||||
this.FullScreenStretchCheckBox.Size = new System.Drawing.Size(186, 17);
|
||||
this.FullScreenStretchCheckBox.TabIndex = 3;
|
||||
this.FullScreenStretchCheckBox.Text = "Stretch screen in Fullscreen mode";
|
||||
this.FullScreenStretchCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// DisplayScaleComboBox
|
||||
//
|
||||
this.DisplayScaleComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
@@ -367,15 +387,53 @@ namespace D.UI
|
||||
this.Cancel_Button.Text = "Cancel";
|
||||
this.Cancel_Button.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// FullScreenFilterCheckBox
|
||||
// lblNetHubHost
|
||||
//
|
||||
this.FullScreenStretchCheckBox.AutoSize = true;
|
||||
this.FullScreenStretchCheckBox.Location = new System.Drawing.Point(6, 55);
|
||||
this.FullScreenStretchCheckBox.Name = "FullScreenFilterCheckBox";
|
||||
this.FullScreenStretchCheckBox.Size = new System.Drawing.Size(186, 17);
|
||||
this.FullScreenStretchCheckBox.TabIndex = 3;
|
||||
this.FullScreenStretchCheckBox.Text = "Stretch screen in Fullscreen mode";
|
||||
this.FullScreenStretchCheckBox.UseVisualStyleBackColor = true;
|
||||
this.lblNetHubHost.AutoSize = true;
|
||||
this.lblNetHubHost.Location = new System.Drawing.Point(10, 150);
|
||||
this.lblNetHubHost.Name = "lblNetHubHost";
|
||||
this.lblNetHubHost.Size = new System.Drawing.Size(72, 13);
|
||||
this.lblNetHubHost.TabIndex = 2;
|
||||
this.lblNetHubHost.Text = "NetHub Host:";
|
||||
//
|
||||
// txtNetHubHost
|
||||
//
|
||||
this.txtNetHubHost.Location = new System.Drawing.Point(81, 147);
|
||||
this.txtNetHubHost.Name = "txtNetHubHost";
|
||||
this.txtNetHubHost.Size = new System.Drawing.Size(166, 20);
|
||||
this.txtNetHubHost.TabIndex = 3;
|
||||
this.txtNetHubHost.Validating += new System.ComponentModel.CancelEventHandler(this.OnNetHubHostValidating);
|
||||
//
|
||||
// numNetHubPort
|
||||
//
|
||||
this.numNetHubPort.Location = new System.Drawing.Point(282, 146);
|
||||
this.numNetHubPort.Maximum = new decimal(new int[] {
|
||||
65535,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numNetHubPort.Minimum = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numNetHubPort.Name = "numNetHubPort";
|
||||
this.numNetHubPort.Size = new System.Drawing.Size(60, 20);
|
||||
this.numNetHubPort.TabIndex = 4;
|
||||
this.numNetHubPort.Value = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
//
|
||||
// lblNetHubPort
|
||||
//
|
||||
this.lblNetHubPort.AutoSize = true;
|
||||
this.lblNetHubPort.Location = new System.Drawing.Point(253, 149);
|
||||
this.lblNetHubPort.Name = "lblNetHubPort";
|
||||
this.lblNetHubPort.Size = new System.Drawing.Size(29, 13);
|
||||
this.lblNetHubPort.TabIndex = 5;
|
||||
this.lblNetHubPort.Text = "Port:";
|
||||
//
|
||||
// ConfigurationDialog
|
||||
//
|
||||
@@ -404,6 +462,7 @@ namespace D.UI
|
||||
this.DisplayTab.PerformLayout();
|
||||
this.TimeTabPage.ResumeLayout(false);
|
||||
this.TimeTabPage.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numNetHubPort)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@@ -436,5 +495,9 @@ namespace D.UI
|
||||
private System.Windows.Forms.DateTimePicker TODDatePicker;
|
||||
private System.Windows.Forms.RadioButton SpecifiedDateRadioButton;
|
||||
private System.Windows.Forms.CheckBox FullScreenStretchCheckBox;
|
||||
private System.Windows.Forms.Label lblNetHubPort;
|
||||
private System.Windows.Forms.NumericUpDown numNetHubPort;
|
||||
private System.Windows.Forms.TextBox txtNetHubHost;
|
||||
private System.Windows.Forms.Label lblNetHubHost;
|
||||
}
|
||||
}
|
||||
@@ -48,6 +48,8 @@ namespace D.UI
|
||||
public bool ThrottleSpeed;
|
||||
|
||||
public string HostPacketInterfaceName;
|
||||
public string NetHubHost;
|
||||
public ushort NetHubPort;
|
||||
|
||||
public bool SlowPhosphor;
|
||||
public uint DisplayScale;
|
||||
@@ -123,13 +125,19 @@ namespace D.UI
|
||||
//
|
||||
// Populate the list with the interfaces available on the machine, if any.
|
||||
//
|
||||
EthernetInterfaceListBox.Enabled = Configuration.HostRawEthernetInterfacesAvailable;
|
||||
EthernetInterfaceListBox.Enabled = true; // Configuration.HostRawEthernetInterfacesAvailable;
|
||||
EthernetInterfaceListBox.Items.Clear();
|
||||
|
||||
|
||||
// Add the "Use no interface" option
|
||||
EthernetInterfaceListBox.Items.Add(
|
||||
new EthernetInterface("None", "No network adapter"));
|
||||
|
||||
// Add the "Use Nethub interface" option
|
||||
EthernetInterfaceListBox.Items.Add(
|
||||
new EthernetInterface(NethubInterface.NETHUB_NAME, "Network adapter to Dodo Nethub"));
|
||||
txtNetHubHost.Text = NetHubHost;
|
||||
numNetHubPort.Value = NetHubPort;
|
||||
|
||||
// Add all interfaces that PCAP knows about.
|
||||
|
||||
@@ -199,7 +207,7 @@ namespace D.UI
|
||||
ulong newValue = Convert.ToUInt64(stripped, 16);
|
||||
|
||||
// Ensure the value is in range
|
||||
if ((newValue & 0xffff0000000000) != 0)
|
||||
if ((newValue & 0xffff000000000000) != 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("HostID");
|
||||
}
|
||||
@@ -228,6 +236,8 @@ namespace D.UI
|
||||
FullScreenStretch = FullScreenStretchCheckBox.Checked;
|
||||
|
||||
HostPacketInterfaceName = ((EthernetInterface)EthernetInterfaceListBox.SelectedItem).Name;
|
||||
NetHubHost = txtNetHubHost.Text;
|
||||
NetHubPort = (ushort)numNetHubPort.Value;
|
||||
|
||||
if (CurrentTimeDateRadioButton.Checked)
|
||||
{
|
||||
@@ -252,5 +262,22 @@ namespace D.UI
|
||||
TODSetMode = TODPowerUpSetMode.NoChange;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEthernetInterfaceChanged(object sender, EventArgs e)
|
||||
{
|
||||
EthernetInterface iface = (EthernetInterface)EthernetInterfaceListBox.SelectedItem;
|
||||
bool isNetHub = (iface.Name == NethubInterface.NETHUB_NAME);
|
||||
txtNetHubHost.Enabled = isNetHub;
|
||||
numNetHubPort.Enabled = isNetHub;
|
||||
}
|
||||
|
||||
private void OnNetHubHostValidating(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
if (String.IsNullOrEmpty(txtNetHubHost.Text))
|
||||
{
|
||||
MessageBox.Show("The NetHub host can not be empty");
|
||||
txtNetHubHost.Text = "localhost";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,6 +101,21 @@ namespace D.UI
|
||||
UpdateFloppyDriveLabel();
|
||||
UpdateMouseState();
|
||||
}
|
||||
|
||||
private bool firstShown = true;
|
||||
|
||||
protected override void OnShown(EventArgs e)
|
||||
{
|
||||
base.OnShown(e);
|
||||
if (firstShown) {
|
||||
firstShown = false;
|
||||
if (Configuration.Start && !_system.IsExecuting)
|
||||
{
|
||||
SystemExecutionContext context = new SystemExecutionContext(null, null, null, OnExecutionError);
|
||||
_system.StartExecution(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// UI Event handlers:
|
||||
@@ -305,6 +320,8 @@ namespace D.UI
|
||||
configDialog.MemorySize = Configuration.MemorySize;
|
||||
configDialog.HostID = Configuration.HostID;
|
||||
configDialog.HostPacketInterfaceName = Configuration.HostPacketInterfaceName;
|
||||
configDialog.NetHubHost = Configuration.NetHubHost;
|
||||
configDialog.NetHubPort = Configuration.NetHubPort;
|
||||
configDialog.ThrottleSpeed = Configuration.ThrottleSpeed;
|
||||
configDialog.DisplayScale = Configuration.DisplayScale;
|
||||
configDialog.FullScreenStretch = Configuration.FullScreenStretch;
|
||||
@@ -331,9 +348,13 @@ namespace D.UI
|
||||
((IOPMemoryBus)_system.IOP.Memory).UpdateHostIDProm();
|
||||
}
|
||||
|
||||
if (configDialog.HostPacketInterfaceName != Configuration.HostPacketInterfaceName)
|
||||
if (configDialog.HostPacketInterfaceName != Configuration.HostPacketInterfaceName
|
||||
|| configDialog.NetHubHost != Configuration.NetHubHost
|
||||
|| configDialog.NetHubPort != Configuration.NetHubPort)
|
||||
{
|
||||
Configuration.HostPacketInterfaceName = configDialog.HostPacketInterfaceName;
|
||||
Configuration.NetHubHost = configDialog.NetHubHost;
|
||||
Configuration.NetHubPort = configDialog.NetHubPort;
|
||||
_system.EthernetController.HostInterfaceChanged();
|
||||
}
|
||||
|
||||
@@ -443,7 +464,7 @@ namespace D.UI
|
||||
|
||||
private void OnFrameTimerTick(object sender, EventArgs e)
|
||||
{
|
||||
FPSStatusLabel.Text = String.Format("{0} Fields/Sec ({1}%)",
|
||||
FPSStatusLabel.Text = String.Format("{0:d3} Fields/Sec ({1:d3}%)",
|
||||
_frameCount,
|
||||
(int)((_frameCount / 77.4) * 100.0));
|
||||
|
||||
@@ -529,6 +550,7 @@ namespace D.UI
|
||||
|
||||
private void PopulateAltBoot()
|
||||
{
|
||||
_system.IOP.MiscIO.AltBoot = Configuration.AltBootMode;
|
||||
for (AltBootValues v = AltBootValues.None; v < AltBootValues.HeadCleaning; v++)
|
||||
{
|
||||
ToolStripMenuItem item = new ToolStripMenuItem(v.ToString());
|
||||
|
||||
Reference in New Issue
Block a user