mirror of
https://github.com/livingcomputermuseum/ContrAlto.git
synced 2026-02-09 09:42:04 +00:00
Minor bugfixes, introduced a new timing infrastructure and moved DiskController over to it. Minor performance improvements; now running at 110% speed. Display timing is still too slow.
This commit is contained in:
40
Contralto/Conversion.cs
Normal file
40
Contralto/Conversion.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
|
||||
namespace Contralto
|
||||
{
|
||||
public static class Conversion
|
||||
{
|
||||
public static string ToOctal(int i)
|
||||
{
|
||||
return Convert.ToString(i, 8);
|
||||
}
|
||||
|
||||
public static string ToOctal(sbyte s)
|
||||
{
|
||||
if (s < 0)
|
||||
{
|
||||
return "-" + Convert.ToString(-s, 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Convert.ToString(s, 8);
|
||||
}
|
||||
}
|
||||
|
||||
public static string ToOctal(int i, int digits)
|
||||
{
|
||||
string octalString = Convert.ToString(i, 8);
|
||||
return new String('0', digits - octalString.Length) + octalString;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Conversion from millseconds to nanoseconds
|
||||
/// </summary>
|
||||
public static readonly ulong MsecToNsec = 1000000;
|
||||
|
||||
/// <summary>
|
||||
/// Conversion from microseconds to nanoseconds
|
||||
/// </summary>
|
||||
public static readonly ulong UsecToNsec = 1000;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user