public void RefreshView() { RegistersTextBox.Text = _currentDevice.Cpu.Registers + "\r\nTick: " + _currentDevice.Cpu.TickCount + "\r\n\r\n" + "LCDC: " + ((byte)_currentDevice.Gpu.Lcdc).ToString("X2") + "\r\n" + "STAT: " + ((byte)_currentDevice.Gpu.Stat).ToString("X2") + "\r\n" + "LY: " + _currentDevice.Gpu.LY.ToString("X2") + "\r\n" + "ScY: " + _currentDevice.Gpu.ScY.ToString("X2") + "\r\n" + "ScX: " + _currentDevice.Gpu.ScX.ToString("X2") + "\r\n" + "\r\n" + "TIMA: " + _currentDevice.Timer.Tima.ToString("X2") + "\r\n" + "TMA: " + _currentDevice.Timer.Tma.ToString("X2") + "\r\n" + "TAC: " + ((byte)_currentDevice.Timer.Tac).ToString("X2") + "\r\n"; ; DisassemblyView.Items.Clear(); var disassembler = new Z80Disassembler(_currentDevice.Memory); var position = _currentDevice.Cpu.Registers.PC; for (int i = 0; i < 30 && position < 0xFFFF; i++) { var instruction = new Z80Instruction(0, Z80OpCodes.SingleByteOpCodes[0], new byte[0]); disassembler.ReadInstruction(ref position, instruction); DisassemblyView.Items.Add(new InstructionItem(_currentDevice, instruction)); } }