mirror of
https://github.com/livingcomputermuseum/ContrAlto.git
synced 2026-04-19 17:13:08 +00:00
Initial commit of changes for 1.2.3. This includes:
- Scripting support: Allows for recording and playback of mouse/keyboard input and various system control actions. Simple (i.e. basic) scripting format. - Fix for stale packets left in ethernet input queue; packets received by pcap while Alto's receiver is off are discarded. - Mouse input made more accurate, and tweaked to avoid Alto microcode bug that causes erroneous mouse inputs under very rare circumstances on real hardware, but much more frequently under emulation. - Small code cleanup here and there. Moved many UI strings to resources, many more to go.
This commit is contained in:
@@ -741,6 +741,7 @@ namespace Contralto
|
||||
{
|
||||
// Belongs to a task, so we can grab the address out as well
|
||||
Address = sourceText.Substring(2, 4);
|
||||
annotated = true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -748,8 +749,14 @@ namespace Contralto
|
||||
annotated = false;
|
||||
}
|
||||
|
||||
Text = sourceText.Substring(tokens[0].Length + 1, sourceText.Length - tokens[0].Length - 1);
|
||||
annotated = true;
|
||||
string sourceCode = sourceText.Substring(tokens[0].Length, sourceText.Length - tokens[0].Length);
|
||||
// Remove leading space if present
|
||||
if (sourceCode.StartsWith(" "))
|
||||
{
|
||||
sourceCode = sourceCode.Substring(1);
|
||||
}
|
||||
|
||||
Text = UnTabify(sourceCode);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -760,7 +767,7 @@ namespace Contralto
|
||||
|
||||
if (!annotated)
|
||||
{
|
||||
Text = sourceText;
|
||||
Text = UnTabify(sourceText);
|
||||
Address = String.Empty;
|
||||
Task = TaskType.Invalid;
|
||||
}
|
||||
@@ -770,6 +777,40 @@ namespace Contralto
|
||||
public string Address;
|
||||
public TaskType Task;
|
||||
|
||||
/// <summary>
|
||||
/// Converts tabs in the given string to 8 space tabulation. As it should be.
|
||||
/// </summary>
|
||||
/// <param name="tabified"></param>
|
||||
/// <returns></returns>
|
||||
private string UnTabify(string tabified)
|
||||
{
|
||||
StringBuilder untabified = new StringBuilder();
|
||||
|
||||
int column = 0;
|
||||
|
||||
foreach (char c in tabified)
|
||||
{
|
||||
if (c == '\t')
|
||||
{
|
||||
untabified.Append(" ");
|
||||
column++;
|
||||
while ((column % 8) != 0)
|
||||
{
|
||||
untabified.Append(" ");
|
||||
column++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
untabified.Append(c);
|
||||
column++;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return untabified.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTabChanged(object sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user