Skip to content

Commit 77c0b07

Browse files
committed
combine PCLine and PC_pointerOffset
Both of them represented the same information.
1 parent bbfad63 commit 77c0b07

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/drivers/win/debugger.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ std::vector<uint16> disassembly_addresses;
128128
// this is used to keep track of addresses in operands of each printed instruction
129129
std::vector<std::vector<uint16>> disassembly_operands;
130130
// this is used to autoscroll the Disassembly window while keeping relative position of the ">" pointer inside this window
131-
unsigned int PC_pointerOffset = 0;
132-
int PCLine = -1;
131+
unsigned int PCLine = -1;
133132
// hack to help syntax highlighting find the PC
134133
int beginningOfPCPointerLine = -1; // index of the first char within debug_str[] string, where the ">" line starts
135134
static int skipLinesStatic = 0;
@@ -746,10 +745,9 @@ void DisassembleToWindow(HWND hWnd, int id, int scrollid, unsigned int addr, int
746745

747746
if (addr == X.PC)
748747
{
749-
PC_pointerOffset = line_count;
748+
PCLine = line_count;
750749
beginningOfPCPointerLine = wcslen(debug_wstr);
751750
wcscat(debug_wstr, L">");
752-
PCLine = line_count;
753751
} else
754752
{
755753
wcscat(debug_wstr, L" ");
@@ -1006,11 +1004,11 @@ void UpdateDebugger(bool jump_to_pc)
10061004
RECT rect;
10071005
GetClientRect(GetDlgItem(hDebug, IDC_DEBUGGER_DISASSEMBLY), &rect);
10081006
unsigned int lines = (rect.bottom-rect.top) / debugSystem->disasmFontHeight;
1009-
if (PC_pointerOffset >= lines)
1010-
PC_pointerOffset = 0;
1007+
if (PCLine >= lines)
1008+
PCLine = 0;
10111009

10121010
// keep the relative position of the ">" pointer inside the Disassembly window
1013-
for (int i = PC_pointerOffset; i > 0; i--)
1011+
for (int i = PCLine; i > 0; i--)
10141012
{
10151013
starting_address = ScrollUp(starting_address);
10161014
}

0 commit comments

Comments
 (0)