From fc92d3c63e49ab99a0fc9c7999377b83888a9055 Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Tue, 17 Nov 2020 19:54:43 -0500 Subject: [PATCH] Debugger: Fix scrolling in disassembly view --- .../CustomControls/InputRoll/InputRoll.cs | 2 +- .../Debugger/GenericDebugger.Designer.cs | 2 +- .../Debugger/GenericDebugger.Disassembler.cs | 50 +++++++------------ 3 files changed, 20 insertions(+), 34 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs index 0bb4bfe228..449b80e523 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs @@ -1617,7 +1617,7 @@ namespace BizHawk.Client.EmuHawk if (_horizontalOrientation) { - ColumnScroll?.Invoke(_vBar, e); + ColumnScroll?.Invoke(_hBar, e); } else { diff --git a/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Designer.cs index efc3a0f3fa..bed4c4d765 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Designer.cs @@ -195,7 +195,7 @@ namespace BizHawk.Client.EmuHawk // this.label1.Location = new System.Drawing.Point(6, 23); this.label1.Name = "label1"; - this.label1.Text = "Cpu:"; + this.label1.Text = "Cpu: Use '[' or ']' to change address, hold 'shift' for speed."; // // DisassemblerView // diff --git a/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Disassembler.cs b/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Disassembler.cs index 9af43a0ca3..585a9ce93a 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Disassembler.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Disassembler.cs @@ -50,7 +50,7 @@ namespace BizHawk.Client.EmuHawk private void Disassemble() { - int lineCount = DisassemblerView.RowCount + 2; + int lineCount = DisassemblerView.RowCount * 6 + 2; _disassemblyLines.Clear(); uint a = _currentDisassemblerAddress; @@ -140,43 +140,17 @@ namespace BizHawk.Client.EmuHawk } } - private bool _blockScroll; private void DisassemblerView_Scroll(object sender, EventArgs e) { - // This is really really gross, but it works - if (_blockScroll) - { - return; - } + if (_blockScroll) { return; } - if (sender is ScrollBar scrollBar) - { - if (scrollBar.Value > 0) - { - SmallIncrement(); - - _blockScroll = true; - scrollBar.Value = 14; - _blockScroll = false; - } - else - { - SmallDecrement(); - - if (_currentDisassemblerAddress != 0) - { - _blockScroll = true; - scrollBar.Value = 14; - _blockScroll = false; - } - } - } + // is this still needed? } private void SetDisassemblerItemCount() { - DisassemblerView.RowCount = DisassemblerView.VisibleRows + 2; + DisassemblerView.RowCount = DisassemblerView.VisibleRows * 6 + 2; } private void DisassemblerView_SizeChanged(object sender, EventArgs e) @@ -208,14 +182,26 @@ namespace BizHawk.Client.EmuHawk { CopySelectedDisassembler(); } - else if (e.IsPressed(Keys.PageDown)) + else if (e.IsPressed(Keys.OemCloseBrackets)) { SmallIncrement(); } - else if (e.IsPressed(Keys.PageUp)) + else if (e.IsPressed(Keys.OemOpenBrackets)) { SmallDecrement(); } + else if (e.IsShift(Keys.OemCloseBrackets)) + { + SmallIncrement(); + SmallIncrement(); + SmallIncrement(); + } + else if (e.IsShift(Keys.OemOpenBrackets)) + { + SmallDecrement(); + SmallDecrement(); + SmallDecrement(); + } } private void CopySelectedDisassembler()