mirror of
https://github.com/livingcomputermuseum/ContrAlto.git
synced 2026-03-09 20:18:33 +00:00
Added "-rompath" startup option to allow specifying an alternate path for microcode ROMs. Updated raw Ethernet handling to work with ncap (which replaces WinPcap since it's no longer being updated) running in WinPcap mode. Fixed bug with DebuggerPrompt -- when run with stdin/out redirected, Console.Width is 0, resulting in a div/zero issue.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -190,3 +190,4 @@ ModelManifest.xml
|
||||
/Contralto.VC.VC.opendb
|
||||
/Contralto.VC.db
|
||||
/.vs/Contralto/v15/Server/sqlite3
|
||||
/.vs/Contralto/DesignTimeBuild/.dtbcache
|
||||
|
||||
@@ -259,17 +259,38 @@ namespace Contralto
|
||||
|
||||
public static string GetAltoIRomPath(string romFileName)
|
||||
{
|
||||
return Path.Combine("ROM", "AltoI", romFileName);
|
||||
if (string.IsNullOrEmpty(StartupOptions.RomPath))
|
||||
{
|
||||
return Path.Combine("ROM", "AltoI", romFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Path.Combine(StartupOptions.RomPath, "AltoI", romFileName);
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetAltoIIRomPath(string romFileName)
|
||||
{
|
||||
return Path.Combine("ROM", "AltoII", romFileName);
|
||||
if (string.IsNullOrEmpty(StartupOptions.RomPath))
|
||||
{
|
||||
return Path.Combine("ROM", "AltoII", romFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Path.Combine(StartupOptions.RomPath, "AltoII", romFileName);
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetRomPath(string romFileName)
|
||||
{
|
||||
return Path.Combine("ROM", romFileName);
|
||||
if (string.IsNullOrEmpty(StartupOptions.RomPath))
|
||||
{
|
||||
return Path.Combine("ROM", romFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Path.Combine(StartupOptions.RomPath, romFileName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -68,7 +68,8 @@ namespace Contralto.IO
|
||||
//
|
||||
// We use the friendly name to make it easier to specify in config files.
|
||||
//
|
||||
if (((WinPcapDevice)device).Interface.FriendlyName.ToLowerInvariant() == name.ToLowerInvariant())
|
||||
if (!string.IsNullOrWhiteSpace(((WinPcapDevice)device).Interface.FriendlyName) &&
|
||||
((WinPcapDevice)device).Interface.FriendlyName.ToLowerInvariant() == name.ToLowerInvariant())
|
||||
{
|
||||
AttachInterface(device);
|
||||
break;
|
||||
|
||||
@@ -27,6 +27,8 @@ namespace Contralto
|
||||
public static string ConfigurationFile;
|
||||
|
||||
public static string ScriptFile;
|
||||
|
||||
public static string RomPath;
|
||||
}
|
||||
|
||||
class Program
|
||||
@@ -67,6 +69,18 @@ namespace Contralto
|
||||
}
|
||||
break;
|
||||
|
||||
case "-rompath":
|
||||
if (i < args.Length)
|
||||
{
|
||||
StartupOptions.RomPath = args[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
PrintUsage();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
PrintUsage();
|
||||
return;
|
||||
|
||||
@@ -199,8 +199,11 @@ namespace Contralto.SdlUI
|
||||
clear = sb.ToString();
|
||||
}
|
||||
|
||||
int column = ((_textPosition + _originColumn) % Console.BufferWidth);
|
||||
int row = ((_textPosition + _originColumn) / Console.BufferWidth) + _originRow;
|
||||
// Default to 80 if BufferWidth is zero (this can happen if stdout is being redirected)
|
||||
int bufferWidth = Console.BufferWidth > 0 ? Console.BufferWidth : 80;
|
||||
|
||||
int column = ((_textPosition + _originColumn) % bufferWidth);
|
||||
int row = ((_textPosition + _originColumn) / bufferWidth) + _originRow;
|
||||
|
||||
// Move cursor to origin to draw string
|
||||
Console.CursorLeft = _originColumn;
|
||||
|
||||
@@ -163,7 +163,15 @@ namespace Contralto.UI
|
||||
{
|
||||
foreach (WinPcapDevice device in CaptureDeviceList.Instance)
|
||||
{
|
||||
EthernetInterfaceListBox.Items.Add(new EthernetInterface(device.Interface.FriendlyName, device.Interface.Description));
|
||||
//
|
||||
// NCap seems to return some interfaces with a null FriendlyName; empirically these
|
||||
// are not real network adapters that would typically be used with ContrAlto so we
|
||||
// will not display them here.
|
||||
//
|
||||
if (!string.IsNullOrWhiteSpace(device.Interface.FriendlyName))
|
||||
{
|
||||
EthernetInterfaceListBox.Items.Add(new EthernetInterface(device.Interface.FriendlyName, device.Interface.Description));
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user