1
0
mirror of https://github.com/livingcomputermuseum/ContrAlto.git synced 2026-04-25 11:41:50 +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:
Josh Dersch
2019-02-21 16:43:44 -08:00
parent 11c168e201
commit 60bb9bfd13
6 changed files with 55 additions and 7 deletions

View File

@@ -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;