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(); }); } }
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); }
Variable CreateVariableForValue(ValueTree value) { value.Refresh(); return(new Variable( value.Name, value.Formatted, "value", value.Children.Count == 0 ? -1 : value.ID, new VariablePresentationHint("data") )); }
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; }
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); }
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); }
public static string ToHex8(ValueTree value) { return(System.Convert.ToByte(value.Content).ToHex()); }
public static string ToHex16(ValueTree value) { return(System.Convert.ToUInt16(value.Content).ToHex()); }
string GetReg(ValueTree val) { return(_session.Machine.Registers[val.Name].ToString()); }
void SetReg(ValueTree val, string content) { _session.Machine.Registers.Set(val.Name, content); }
void SetupValues_Settings(ValueTree val) { }