@@ -258,6 +258,7 @@ unsigned int AddBreak(HWND hwndDlg)
258258
259259// This function is for "smart" scrolling...
260260// it attempts to scroll up one line by a whole instruction
261+ // Should we add the label-respecting logic from dumper.cpp?
261262int InstructionUp (int from)
262263{
263264 int i = std::min (16 , from), j;
@@ -562,7 +563,7 @@ void UpdateDisassembleView(HWND hWnd, UINT id, int lines, bool text = false)
562563 SendDlgItemMessage (hWnd, id, EM_SETEVENTMASK, 0 , eventMask);
563564}
564565
565- void Disassemble (HWND hWnd, int id, int scrollid, unsigned int addr)
566+ void DisassembleToWindow (HWND hWnd, int id, int scrollid, unsigned int addr)
566567{
567568 wchar_t chr[40 ] = { 0 };
568569 wchar_t debug_wbuf[2048 ] = { 0 };
@@ -903,7 +904,7 @@ void UpdateDebugger(bool jump_to_pc)
903904 {
904905 starting_address = InstructionUp (starting_address);
905906 }
906- Disassemble (hDebug, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, starting_address);
907+ DisassembleToWindow (hDebug, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, starting_address);
907908
908909 // HACK, but I don't see any other way to ensure the ">" pointer is visible when "Symbolic debug" is enabled
909910 if (!PCPointerWasDrawn && PC_pointerOffset)
@@ -912,14 +913,14 @@ void UpdateDebugger(bool jump_to_pc)
912913 PC_pointerOffset = 0 ;
913914 starting_address = X.PC ;
914915 // retry with (PC_pointerOffset = 0) now
915- Disassemble (hDebug, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, starting_address);
916+ DisassembleToWindow (hDebug, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, starting_address);
916917 }
917918
918919 starting_address = X.PC ;
919920 } else
920921 {
921922 starting_address = disassembly_addresses[0 ];
922- Disassemble (hDebug, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, starting_address);
923+ DisassembleToWindow (hDebug, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, starting_address);
923924 }
924925
925926
@@ -1232,7 +1233,7 @@ BOOL CALLBACK DebuggerEnumWindowsProc(HWND hwnd, LPARAM lParam)
12321233 crect.bottom += dy_l;
12331234 SetWindowPos (hwnd, 0 , 0 , 0 , crect.right - crect.left , crect.bottom - crect.top , SWP_NOZORDER | SWP_NOMOVE);
12341235 GetScrollInfo (GetDlgItem (parent, IDC_DEBUGGER_DISASSEMBLY_VSCR), SB_CTL, &si);
1235- Disassemble (parent, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, si.nPos );
1236+ DisassembleToWindow (parent, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, si.nPos );
12361237 break ;
12371238 case IDC_DEBUGGER_DISASSEMBLY_LEFT_PANEL:
12381239 // vertical stretch, no movement
@@ -1665,10 +1666,10 @@ inline void UpdateSymbolsPopup(HMENU symbolsPopup)
16651666 EnableMenuItem (symbolsPopup, ID_DEBUGGER_RELOAD_SYMBOLS, EnabledFlag (GameInfo));
16661667}
16671668
1668- inline void UpdateToolsPopup (HMENU symbolsPopup )
1669+ inline void UpdateToolsPopup (HMENU toolsPopup )
16691670{
1670- EnableMenuItem (symbolsPopup , ID_DEBUGGER_ROM_PATCHER, EnabledFlag (GameInfo));
1671- EnableMenuItem (symbolsPopup , ID_DEBUGGER_CODE_DUMPER, EnabledFlag (GameInfo));
1671+ EnableMenuItem (toolsPopup , ID_DEBUGGER_ROM_PATCHER, EnabledFlag (GameInfo));
1672+ EnableMenuItem (toolsPopup , ID_DEBUGGER_CODE_DUMPER, EnabledFlag (GameInfo));
16721673}
16731674
16741675void DebuggerInitDialog (HWND hwndDlg)
@@ -2118,7 +2119,7 @@ void DebuggerBnClicked(HWND hwndDlg, uint16 btnId, HWND hwndBtn)
21182119 {
21192120 sprintf (str," %04X" , tmp);
21202121 SetDlgItemText (hwndDlg,IDC_DEBUGGER_VAL_PCSEEK,str);
2121- Disassemble (hDebug, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, tmp);
2122+ DisassembleToWindow (hDebug, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, tmp);
21222123 // The address in the Add Bookmark textbox follows the scroll pos.
21232124 sprintf (str," %04X" , si.nPos );
21242125 SetDlgItemText (hDebug, IDC_DEBUGGER_BOOKMARK, str);
@@ -2313,7 +2314,7 @@ void DebuggerVScroll(HWND hwndDlg, uint16 eventType, uint16 scrollPos, HWND hwnd
23132314 si.nPos = si.nMax - si.nPage ;
23142315 SetScrollInfo (hwndScrollBar, SB_CTL, &si, TRUE );
23152316
2316- Disassemble (hwndDlg, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, si.nPos );
2317+ DisassembleToWindow (hwndDlg, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, si.nPos );
23172318 // The address in the Add Bookmark textbox follows the scroll pos.
23182319 char str[16 ];
23192320 sprintf (str," %04X" , si.nPos );
@@ -2354,7 +2355,7 @@ void DebuggerMouseWheel(HWND hwndDlg, int16 rotAmt, uint16 cursorX, uint16 curso
23542355 }
23552356
23562357 // This function calls UpdateScrollInfo. Don't worry!
2357- Disassemble (hDebug, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, si.nPos );
2358+ DisassembleToWindow (hDebug, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, si.nPos );
23582359 // The address in the Add Bookmark textbox follows the scroll pos.
23592360 char str[16 ];
23602361 sprintf (str," %04X" , si.nPos );
0 commit comments