Skip to content

Commit e62d1e3

Browse files
committed
rename stuff and add comments
1 parent 9288c21 commit e62d1e3

File tree

7 files changed

+20
-17
lines changed

7 files changed

+20
-17
lines changed

src/drivers/win/debugger.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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?
261262
int 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

16741675
void 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);

src/drivers/win/debugger.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ extern char* BreakToText(unsigned int num);
3838
void UpdateDebugger(bool jump_to_pc = true);
3939
void DoDebug(uint8 halt);
4040
void DebuggerExit();
41-
void Disassemble(HWND hWnd, int id, int scrollid, unsigned int addr);
41+
void DisassembleToWindow(HWND hWnd, int id, int scrollid, unsigned int addr);
4242
void PrintOffsetToSeekAndBookmarkFields(int offset);
4343

4444
void LoadGameDebuggerData(HWND hwndDlg);

src/drivers/win/debuggersp.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,8 @@ void replaceRegNames(char* str)
640640
/**
641641
* Searches an address node in a list of address nodes. The found node
642642
* has the same offset as the passed parameter offs.
643+
*
644+
* Could speed this up with an actual data structure...
643645
*
644646
* @param node The address node list
645647
* @offs The offset to search
@@ -917,7 +919,7 @@ void GoToDebuggerBookmark(HWND hwnd)
917919
// If no bookmark is selected just return
918920
if (selectedItem == LB_ERR) return;
919921
unsigned int n = getBookmarkAddress(selectedItem);
920-
Disassemble(hwnd, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, n);
922+
DisassembleToWindow(hwnd, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, n);
921923
}
922924

923925
INT_PTR CALLBACK SymbolicNamingCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)

src/drivers/win/debuggersp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,5 @@ void AddNewSymbolicName(uint16 newAddress, char* newOffset, char* newName, char*
7171
void DeleteSymbolicName(uint16 address, int size);
7272
void WriteNameFileToDisk(const char* filename, Name* node);
7373

74-
extern void Disassemble(HWND hWnd, int id, int scrollid, unsigned int addr);
74+
extern void DisassembleToWindow(HWND hWnd, int id, int scrollid, unsigned int addr);
7575
extern void CenterWindow(HWND hwnd);

src/drivers/win/dumper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static OPENFILENAME ofn;
5151
* A9 10 LDA #$10
5252
* 60 RTS
5353
*
54-
* There is a lot of reused logic between this and Disassemble. However, they're different enough that it would
54+
* There is a lot of reused logic between this and DisassembleToWindow. However, they're different enough that it would
5555
* be more trouble than it's worth to combine them.
5656
*/
5757
void Dump(FILE *fout, unsigned int startAddr, unsigned int endAddr)

src/drivers/win/taseditor/history.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class HISTORY
108108
int registerChanges(int mod_type, int start = 0, int end =-1, int size = 0, const char* comment = NULL, int consecutivenessTag = 0, RowsSelection* frameset = NULL);
109109
int registerAdjustLag(int start, int size);
110110
void registerMarkersChange(int modificationType, int start = 0, int end =-1, const char* comment = 0);
111-
void registerBookmarkSet(int slot, BOOKMARK& backupÑopy, int oldCurrentBranch);
111+
void registerBookmarkSet(int slot, BOOKMARK& backupCopy, int oldCurrentBranch);
112112
int registerBranching(int slot, bool markersWereChanged);
113113
void registerRecording(int frameOfChange, uint32 joypadDifferenceBits);
114114
int registerImport(MovieData& md, char* filename);

src/drivers/win/tracer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ BOOL CALLBACK IDC_TRACER_LOG_WndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPA
244244
DoDebug(0);
245245
if (hDebug)
246246
{
247-
Disassemble(hDebug, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, offset);
247+
DisassembleToWindow(hDebug, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, offset);
248248
PrintOffsetToSeekAndBookmarkFields(offset);
249249
}
250250
}

0 commit comments

Comments
 (0)