mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2024-09-28 21:56:00 +00:00
a9a03d946a
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
namespace Fuse
|
|
{
|
|
using System.Collections.Generic;
|
|
|
|
public class Test
|
|
{
|
|
public bool Valid => !string.IsNullOrEmpty(this.Description);
|
|
|
|
public string Description { get; private set; }
|
|
|
|
public RegisterState RegisterState { get; } = new RegisterState();
|
|
|
|
public List<MemoryDatum> MemoryData { get; } = new List<MemoryDatum>();
|
|
|
|
public void Parse(Lines lines)
|
|
{
|
|
while (!lines.EndOfFile && !this.Valid)
|
|
{
|
|
this.Description = lines.ReadLine();
|
|
}
|
|
|
|
if (!this.Valid)
|
|
{
|
|
return;
|
|
}
|
|
|
|
this.RegisterState.Parse(lines);
|
|
|
|
var finished = false;
|
|
do
|
|
{
|
|
var line = lines.ReadLine();
|
|
finished = line == "-1";
|
|
if (!finished)
|
|
{
|
|
var datum = new MemoryDatum();
|
|
datum.Parse(line);
|
|
this.MemoryData.Add(datum);
|
|
}
|
|
}
|
|
while (!finished);
|
|
}
|
|
}
|
|
}
|