Пример #1
0
 void SetupValues_Paging(ValueTree val)
 {
     val.ClearChildren();
     foreach (var p in _session.Machine.Memory.Slots)
     {
         var slot = val.Create(p.Min.ToHex(), delegate(ValueTree pValue) { pValue.Content = p.Bank.ID.ToString(); });
     }
 }
Пример #2
0
        public void Configure()
        {
            _registersValues = _session.Values.Create("Registers");
            SetupValues_Registers(_registersValues);

            _pagingValues = _session.Values.Create("Paging", refresher: SetupValues_Paging);
            SetupValues_Paging(_pagingValues);

            _settingsValues = _session.Values.Create("Settings");
            SetupValues_Settings(_settingsValues);
        }
Пример #3
0
        Variable CreateVariableForValue(ValueTree value)
        {
            value.Refresh();

            return(new Variable(
                       value.Name,
                       value.Formatted,
                       "value",
                       value.Children.Count == 0 ? -1 : value.ID,
                       new VariablePresentationHint("data")
                       ));
        }
Пример #4
0
        ValueTree(ValueTree parent, ValueRefresher refresher = null, ValueGetter getter = null, ValueSetter setter = null, ValueTree.ValueFormatter formatter = null)
        {
            Parent          = parent;
            _all            = parent._all;
            _allByName      = parent._allByName;
            _children       = new Dictionary <int, ValueTree>();
            _childrenByName = new Dictionary <string, ValueTree>();

            Getter    = getter;
            Setter    = setter;
            Formatter = formatter;
            Refresher = refresher;
        }
Пример #5
0
        void SetupValues_Registers(ValueTree val)
        {
            ValueTree reg16;

            val.Create("A", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);

            reg16 = val.Create("HL", getter: GetReg, setter: SetReg, formatter: Convert.ToHex16);
            reg16.Create("H", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);
            reg16.Create("L", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);

            reg16 = val.Create("BC", getter: GetReg, setter: SetReg, formatter: Convert.ToHex16);
            reg16.Create("B", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);
            reg16.Create("C", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);

            reg16 = val.Create("DE", getter: GetReg, setter: SetReg, formatter: Convert.ToHex16);
            reg16.Create("D", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);
            reg16.Create("E", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);


            val.Create("A'", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);

            reg16 = val.Create("HL'", getter: GetReg, setter: SetReg, formatter: Convert.ToHex16);
            reg16.Create("H'", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);
            reg16.Create("L'", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);

            reg16 = val.Create("BC'", getter: GetReg, setter: SetReg, formatter: Convert.ToHex16);
            reg16.Create("B'", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);
            reg16.Create("C'", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);

            reg16 = val.Create("DE'", getter: GetReg, setter: SetReg, formatter: Convert.ToHex16);
            reg16.Create("D'", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);
            reg16.Create("E'", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);


            reg16 = val.Create("IX", getter: GetReg, setter: SetReg, formatter: Convert.ToHex16);
            reg16.Create("IXH", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);
            reg16.Create("IXL", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);

            reg16 = val.Create("IY", getter: GetReg, setter: SetReg, formatter: Convert.ToHex16);
            reg16.Create("IYH", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);
            reg16.Create("IYL", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);

            val.Create("PC", getter: GetReg, setter: SetReg, formatter: Convert.ToHex16);

            val.Create("SP", getter: GetReg, setter: SetReg, formatter: Convert.ToHex16);

            val.Create("I", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);

            val.Create("R", getter: GetReg, setter: SetReg, formatter: Convert.ToHex8);
        }
Пример #6
0
        public ValueTree Create(string name, ValueRefresher refresher = null, ValueGetter getter = null, ValueSetter setter = null, ValueTree.ValueFormatter formatter = null)
        {
            var value = new ValueTree(this, refresher, getter, setter, formatter)
            {
                ID   = _all.Count + 1,
                Name = name
            };

            _all[value.ID]         = value;
            _allByName[value.Name] = value;

            _children[value.ID]         = value;
            _childrenByName[value.Name] = value;

            Children.Add(value);

            return(value);
        }
Пример #7
0
 public static string ToHex8(ValueTree value)
 {
     return(System.Convert.ToByte(value.Content).ToHex());
 }
Пример #8
0
 public static string ToHex16(ValueTree value)
 {
     return(System.Convert.ToUInt16(value.Content).ToHex());
 }
Пример #9
0
 string GetReg(ValueTree val)
 {
     return(_session.Machine.Registers[val.Name].ToString());
 }
Пример #10
0
 void SetReg(ValueTree val, string content)
 {
     _session.Machine.Registers.Set(val.Name, content);
 }
Пример #11
0
 void SetupValues_Settings(ValueTree val)
 {
 }