More tidyups

This commit is contained in:
Adrian Conlon 2024-05-31 12:00:31 +01:00
parent 75c96929bf
commit 301cd0c1e2
2 changed files with 8 additions and 4 deletions

View File

@ -4,6 +4,7 @@
namespace EightBit
{
using System.Globalization;
using System.Text;
public class Disassembler(Bus bus, M6502 processor, Symbols symbols)
@ -27,9 +28,9 @@ namespace EightBit
return returned.ToString();
}
public static string DumpByteValue(byte value) => value.ToString("X2");
public static string DumpByteValue(byte value) => value.ToString("X2", CultureInfo.InvariantCulture);
public static string DumpWordValue(ushort value) => value.ToString("X4");
public static string DumpWordValue(ushort value) => value.ToString("X4", CultureInfo.InvariantCulture);
public string Disassemble(ushort current)
{

View File

@ -4,6 +4,8 @@
namespace EightBit
{
using System.Globalization;
public class Symbols
{
private readonly Dictionary<string, Dictionary<string, Dictionary<string, string>>> parsed = [];
@ -13,8 +15,9 @@ namespace EightBit
{
}
public Symbols(string path)
public Symbols(string? path)
{
ArgumentNullException.ThrowIfNull(path);
if (path.Length > 0)
{
this.Parse(path);
@ -40,7 +43,7 @@ namespace EightBit
var name = parsedScope["name"];
var trimmedName = name[1..^1];
var size = parsedScope["size"];
this.Scopes[trimmedName] = ushort.Parse(size);
this.Scopes[trimmedName] = ushort.Parse(size, CultureInfo.InvariantCulture);
}
}