private void WriteVal(char val) { string hex = string.Empty; char[] halfs = TGUIUtils.Get8bitHalfs((byte)_cursorPointedDisplayValue); if (_writeCursorH) { hex = halfs[0].ToString() + val.ToString(); _writeCursorH = false; _currentCaretPos.X--; } else { hex = val.ToString() + halfs[1].ToString(); _currentCaretPos.X++; _writeCursorH = true; } byte b = (byte)int.Parse(hex, System.Globalization.NumberStyles.HexNumber); if (_focus == 0) { _emu8051.WriteMem(_memoryFrameMode, _cursorPointedAddress, b); } else if (_focus == 1) { _emu8051.WriteReg(_cursorPointedAddress, b); } else if (_focus == 2) { _dataelements["data_pointer"][0, _cursorPointedAddress] = b; short dptr = TGUIUtils.BytesTo16Bit(_dataelements["data_pointer"][0, 1], _dataelements["data_pointer"][0, 0]); _emu8051.WriteReg(10, dptr); } else if (_focus == 3) { _addrInputVal[_cursorPointedAddress] = b; } }
private short GetInputAddr() { return(TGUIUtils.BytesTo16Bit( _addrInputVal[1], _addrInputVal[0])); }