mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2024-11-14 23:05:32 +00:00
9550ed57be
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
// <copyright file="RegisterState.cs" company="Adrian Conlon">
|
|
// Copyright (c) Adrian Conlon. All rights reserved.
|
|
// </copyright>
|
|
namespace Fuse
|
|
{
|
|
using System;
|
|
using System.Globalization;
|
|
|
|
public class RegisterState : AbstractRegisterState, IRegisterState
|
|
{
|
|
public int I { get; private set; } = -1;
|
|
|
|
public int R { get; private set; } = -1;
|
|
|
|
public bool IFF1 { get; private set; } = false;
|
|
|
|
public bool IFF2 { get; private set; } = false;
|
|
|
|
public int IM { get; private set; } = -1;
|
|
|
|
protected override void ParseInternalState(string[] tokens)
|
|
{
|
|
this.I = Convert.ToInt32(tokens[0], 16);
|
|
this.R = Convert.ToInt32(tokens[1], 16);
|
|
this.IFF1 = Convert.ToInt32(tokens[2], CultureInfo.InvariantCulture) == 1;
|
|
this.IFF2 = Convert.ToInt32(tokens[3], CultureInfo.InvariantCulture) == 1;
|
|
this.IM = Convert.ToInt32(tokens[4], CultureInfo.InvariantCulture);
|
|
this.Halted = Convert.ToInt32(tokens[5], CultureInfo.InvariantCulture) == 1;
|
|
this.TStates = Convert.ToInt32(tokens[6], CultureInfo.InvariantCulture);
|
|
}
|
|
}
|
|
}
|