From 45d4e9fc4e78590dd004b63089f3d2a58fe4cbcf Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:29:03 -0500 Subject: [PATCH 01/42] Update Assembler.h Fix title case --- Source/Project64/UserInterface/Debugger/Assembler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/Assembler.h b/Source/Project64/UserInterface/Debugger/Assembler.h index b676982cf..150ff5d14 100644 --- a/Source/Project64/UserInterface/Debugger/Assembler.h +++ b/Source/Project64/UserInterface/Debugger/Assembler.h @@ -7,8 +7,8 @@ typedef void(*ASM_SYNTAX_FN)(uint32_t* opcode); typedef struct { const char* name; uint32_t val; - uint32_t(*base)(uint32_t val); // value shift - const ASM_SYNTAX_FN* syntax; // arguments + uint32_t(*base)(uint32_t val); // Value shift + const ASM_SYNTAX_FN* syntax; // Arguments } ASM_INSTRUCTION; typedef struct { From c4ac46b501e22d16da8c10d712a4df1efe5c2f70 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:29:09 -0500 Subject: [PATCH 02/42] Update Breakpoints.h Add newline --- Source/Project64/UserInterface/Debugger/Breakpoints.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/Breakpoints.h b/Source/Project64/UserInterface/Debugger/Breakpoints.h index 101646972..34bd20e8c 100644 --- a/Source/Project64/UserInterface/Debugger/Breakpoints.h +++ b/Source/Project64/UserInterface/Debugger/Breakpoints.h @@ -90,4 +90,4 @@ private: bool m_bHaveRegBP; uint32_t m_GPRWriteBP, m_GPRReadBP; bool m_HIWriteBP, m_HIReadBP, m_LOWriteBP, m_LOReadBP; -}; \ No newline at end of file +}; From 23df501cc8146d1d75b79a151ab23e91a1d8c0a4 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:29:16 -0500 Subject: [PATCH 03/42] Update CPULog.cpp Add newline --- Source/Project64/UserInterface/Debugger/CPULog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/CPULog.cpp b/Source/Project64/UserInterface/Debugger/CPULog.cpp index 8dd85feaf..790518f74 100644 --- a/Source/Project64/UserInterface/Debugger/CPULog.cpp +++ b/Source/Project64/UserInterface/Debugger/CPULog.cpp @@ -182,4 +182,4 @@ void CCPULog::DumpToFile(const char* path) } fclose(fp); -} \ No newline at end of file +} From fba5dda943bbe777ce20ee7752dc3ef8b50d5b6b Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:29:23 -0500 Subject: [PATCH 04/42] Update DebugDialog.h Add newline --- Source/Project64/UserInterface/Debugger/DebugDialog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/DebugDialog.h b/Source/Project64/UserInterface/Debugger/DebugDialog.h index 5eacc3358..f5c400ca0 100644 --- a/Source/Project64/UserInterface/Debugger/DebugDialog.h +++ b/Source/Project64/UserInterface/Debugger/DebugDialog.h @@ -132,4 +132,4 @@ private: bool m_SaveWnd; LONG m_SaveWndTop; LONG m_SaveWndLeft; -}; \ No newline at end of file +}; From 5f2dc84981447b0c294f1add0f6758010fe6dce0 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:29:30 -0500 Subject: [PATCH 05/42] Update Debugger-AddBreakpoint.cpp Add newline --- .../Project64/UserInterface/Debugger/Debugger-AddBreakpoint.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-AddBreakpoint.cpp b/Source/Project64/UserInterface/Debugger/Debugger-AddBreakpoint.cpp index 23655d427..8b568d6b6 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-AddBreakpoint.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-AddBreakpoint.cpp @@ -44,4 +44,4 @@ LRESULT CAddBreakpointDlg::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND, BOOL& break; } return FALSE; -} \ No newline at end of file +} From f8efc672588e2418818456b1ec915076285d821d Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:29:38 -0500 Subject: [PATCH 06/42] Update Debugger-AddBreakpoint.h Add newline --- .../Project64/UserInterface/Debugger/Debugger-AddBreakpoint.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-AddBreakpoint.h b/Source/Project64/UserInterface/Debugger/Debugger-AddBreakpoint.h index dcbf608bc..f0e24454b 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-AddBreakpoint.h +++ b/Source/Project64/UserInterface/Debugger/Debugger-AddBreakpoint.h @@ -31,4 +31,4 @@ private: COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked) MSG_WM_DESTROY(OnDestroy) END_MSG_MAP() -}; \ No newline at end of file +}; From 33fed5583581e0d1e56f1165b7ef50170e9f4e1e Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:29:46 -0500 Subject: [PATCH 07/42] Update Debugger-AddSymbol.cpp Add newline --- Source/Project64/UserInterface/Debugger/Debugger-AddSymbol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-AddSymbol.cpp b/Source/Project64/UserInterface/Debugger/Debugger-AddSymbol.cpp index e62483075..07baa000f 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-AddSymbol.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-AddSymbol.cpp @@ -115,4 +115,4 @@ INT_PTR CAddSymbolDlg::DoModal(CDebuggerUI* debugger, uint32_t initAddress, int m_InitAddress = initAddress; m_InitType = initType; return CDialogImpl::DoModal(); -} \ No newline at end of file +} From 7a439e5f7e7fae23d1965d145a33b3112e486da2 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:30:48 -0500 Subject: [PATCH 08/42] Update Debugger-CPULogView.cpp Change wording --- Source/Project64/UserInterface/Debugger/Debugger-CPULogView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-CPULogView.cpp b/Source/Project64/UserInterface/Debugger/Debugger-CPULogView.cpp index ff4f9ac4f..c7766267b 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-CPULogView.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-CPULogView.cpp @@ -412,7 +412,7 @@ void CDebugCPULogView::Export(void) } } -// util +// Utility int CDebugCPULogView::GetNumVisibleRows(CListViewCtrl& list) { From c0bd0dba2e8b85d10e309bb7ef856372253ecb5b Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:30:56 -0500 Subject: [PATCH 09/42] Update Debugger-ExceptionBreakpoints.cpp Add newline --- .../UserInterface/Debugger/Debugger-ExceptionBreakpoints.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-ExceptionBreakpoints.cpp b/Source/Project64/UserInterface/Debugger/Debugger-ExceptionBreakpoints.cpp index a514e0f6f..dd406d348 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-ExceptionBreakpoints.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-ExceptionBreakpoints.cpp @@ -181,4 +181,4 @@ void CDebugExcBreakpoints::EnableCheckboxes(ExcCheckboxMeta* checkboxMap, bool b { ::EnableWindow(GetDlgItem(checkboxMap[i].ctrlId), bEnable); } -} \ No newline at end of file +} From e92a29493e73052961fb2f7b3db0221975df7d02 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:31:54 -0500 Subject: [PATCH 10/42] Update Debugger-MemoryDump.cpp Fix title case, add newline --- .../UserInterface/Debugger/Debugger-MemoryDump.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-MemoryDump.cpp b/Source/Project64/UserInterface/Debugger/Debugger-MemoryDump.cpp index 8bdac8e86..abc7aeed4 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-MemoryDump.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-MemoryDump.cpp @@ -102,7 +102,7 @@ LRESULT CDumpMemory::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl GetDlgItemText(IDC_FILENAME, FileName, sizeof(FileName)); if (wcslen(FileName) == 0) { - g_Notify->DisplayWarning("Please Choose target file"); + g_Notify->DisplayWarning("Please choose target file"); ::SetFocus(GetDlgItem(IDC_FILENAME)); return false; } @@ -110,7 +110,7 @@ LRESULT CDumpMemory::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl { DumpPC = StartPC; } - //disable buttons + // Disable buttons ::EnableWindow(GetDlgItem(IDC_E_START_ADDR), FALSE); ::EnableWindow(GetDlgItem(IDC_E_END_ADDR), FALSE); ::EnableWindow(GetDlgItem(IDC_E_ALT_PC), FALSE); @@ -123,7 +123,7 @@ LRESULT CDumpMemory::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_DumpMemory); if (!DumpMemory(FileName, Format, StartPC, EndPC, DumpPC)) { - //enable buttons + // Enable buttons g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_DumpMemory); return false; } @@ -204,4 +204,4 @@ bool CDumpMemory::DumpMemory(LPCTSTR FileName, DumpFormat Format, DWORD StartPC, } return false; -} \ No newline at end of file +} From 58802684b1098017910a3381c7a0c1b2fa7f7576 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:32:34 -0500 Subject: [PATCH 11/42] Update Debugger-MemorySearch.h Remove unnecessary comments, fix title case and abbreviations, fix wording --- .../UserInterface/Debugger/Debugger-MemorySearch.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-MemorySearch.h b/Source/Project64/UserInterface/Debugger/Debugger-MemorySearch.h index 799ab5626..d62a12510 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-MemorySearch.h +++ b/Source/Project64/UserInterface/Debugger/Debugger-MemorySearch.h @@ -43,8 +43,6 @@ public: END_MSG_MAP() }; -////////////// - class CSetValueDlg : public CDialogImpl { public: @@ -100,10 +98,6 @@ private: END_MSG_MAP() }; -////////////// - - - class CDebugMemorySearch : public CDebugDialog, public CDialogResize @@ -230,13 +224,12 @@ private: CPath GetWatchListPath(void); - /* generic ui util */ + // Generic UI utility void FixListHeader(CListViewCtrl& listCtrl); void SetComboBoxSelByData(CComboBox& cb, DWORD_PTR data); bool MouseHovering(WORD ctrlId, int hMargin = 0, int vMargin = 0); int GetNumVisibleRows(CListViewCtrl& list); - /*******************/ - + bool m_bJalSelected; bool m_bJalHexWasChecked; bool m_bJalUnsignedWasChecked; From b29be48a8896c85df62304b1df080453ccac41a3 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:32:41 -0500 Subject: [PATCH 12/42] Update Debugger-RegisterTabData.h Add newline --- .../Project64/UserInterface/Debugger/Debugger-RegisterTabData.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabData.h b/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabData.h index 16a98b650..b9c698f5d 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabData.h +++ b/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabData.h @@ -330,4 +330,4 @@ public: }; static constexpr TabRecord DD = TabRecord{sizeof(DDFields), DDFields}; -}; \ No newline at end of file +}; From 1755dedff63c2336554269cc1ce43aae3ce0e80c Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:33:25 -0500 Subject: [PATCH 13/42] Update Debugger-RegisterTabs.h Fix capitalization, add newline --- .../Project64/UserInterface/Debugger/Debugger-RegisterTabs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabs.h b/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabs.h index 0888a1224..05c0d45e0 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabs.h +++ b/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabs.h @@ -132,7 +132,7 @@ private: "Virtual coherency (data)" }; - // for static dlgprocs, assumes single instance + // For static dlgprocs, assumes single instance static bool m_bColorsEnabled; static CDebuggerUI* m_Debugger; @@ -182,4 +182,4 @@ private: CWindow m_DDTab; CEditNumber32 m_DDEdits[TabData::DD.FieldCount]; -}; \ No newline at end of file +}; From 5682b9d5b7bf90ac063412dabba5f57c7fab4e45 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:33:55 -0500 Subject: [PATCH 14/42] Update Debugger-Scripts.cpp Fix title case and capitalization --- .../Project64/UserInterface/Debugger/Debugger-Scripts.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-Scripts.cpp b/Source/Project64/UserInterface/Debugger/Debugger-Scripts.cpp index 72febf6a4..00c7b4079 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-Scripts.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-Scripts.cpp @@ -439,7 +439,7 @@ void CDebugScripts::RunSelected() } else { - m_Debugger->Debug_LogScriptsWindow("[Error: Script is already running]\n"); + m_Debugger->Debug_LogScriptsWindow("[Error: script is already running]\n"); } } @@ -513,7 +513,7 @@ LRESULT CEditEval::OnKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BO SetWindowText(L""); int historySize = m_History.size(); - // remove duplicate + // Remove duplicate for (int i = 0; i < historySize; i++) { if (wcscmp(code, m_History[i]) == 0) @@ -525,7 +525,7 @@ LRESULT CEditEval::OnKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BO } } - // remove oldest if maxed + // Remove oldest if maxed if (historySize >= HISTORY_MAX_ENTRIES) { m_History.erase(m_History.begin() + 0); From f52cf3a8b12d907ec719f51eec0ff845032504f2 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:34:08 -0500 Subject: [PATCH 15/42] Update Debugger-StackTrace.cpp Fix title case and add newline --- .../Project64/UserInterface/Debugger/Debugger-StackTrace.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-StackTrace.cpp b/Source/Project64/UserInterface/Debugger/Debugger-StackTrace.cpp index 4ffea385f..dda703b5e 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-StackTrace.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-StackTrace.cpp @@ -81,7 +81,7 @@ void CDebugStackTrace::Refresh() return; } - SetWindowText(stdstr_f("Stack Trace (%d)", m_EntriesIndex).ToUTF16().c_str()); + SetWindowText(stdstr_f("Stack trace (%d)", m_EntriesIndex).ToUTF16().c_str()); m_List.SetRedraw(FALSE); m_List.DeleteAllItems(); @@ -108,4 +108,4 @@ void CDebugStackTrace::Refresh() } m_List.SetRedraw(TRUE); -} \ No newline at end of file +} From 0879ff0d35dcc7fde9692ae96bdfdf3fa84af843 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:34:24 -0500 Subject: [PATCH 16/42] Update Debugger-StackTrace.h Add newline --- Source/Project64/UserInterface/Debugger/Debugger-StackTrace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-StackTrace.h b/Source/Project64/UserInterface/Debugger/Debugger-StackTrace.h index 318b6add3..63ba81fb7 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-StackTrace.h +++ b/Source/Project64/UserInterface/Debugger/Debugger-StackTrace.h @@ -70,4 +70,4 @@ private: BEGIN_DLGRESIZE_MAP(CDebugStackTrace) DLGRESIZE_CONTROL(IDC_STACKTRACE_LIST, DLSZ_SIZE_X | DLSZ_SIZE_Y) END_DLGRESIZE_MAP() -}; \ No newline at end of file +}; From c0a539c802c1864f62ad79172ecedc29fcaed360 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:34:33 -0500 Subject: [PATCH 17/42] Update Debugger-StackView.cpp Add newline --- Source/Project64/UserInterface/Debugger/Debugger-StackView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-StackView.cpp b/Source/Project64/UserInterface/Debugger/Debugger-StackView.cpp index c528a52b1..8634fc560 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-StackView.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-StackView.cpp @@ -104,4 +104,4 @@ void CDebugStackView::Refresh() } m_StackList.SetRedraw(TRUE); -} \ No newline at end of file +} From b7799663ca7ab7b2091d808c3c0a361f4a6c1aaf Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:34:40 -0500 Subject: [PATCH 18/42] Update Debugger-StackView.h Add newline --- Source/Project64/UserInterface/Debugger/Debugger-StackView.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-StackView.h b/Source/Project64/UserInterface/Debugger/Debugger-StackView.h index 9149afc77..57cad478a 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-StackView.h +++ b/Source/Project64/UserInterface/Debugger/Debugger-StackView.h @@ -32,4 +32,4 @@ private: BEGIN_DLGRESIZE_MAP(CDebugStackView) DLGRESIZE_CONTROL(IDC_STACK_LIST, DLSZ_SIZE_X | DLSZ_SIZE_Y) END_DLGRESIZE_MAP() -}; \ No newline at end of file +}; From 409ca3b520a1589a49871486b40bfd8fc44cf12e Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:36:04 -0500 Subject: [PATCH 19/42] Update Debugger-Symbols.h Fix TODO comment --- Source/Project64/UserInterface/Debugger/Debugger-Symbols.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-Symbols.h b/Source/Project64/UserInterface/Debugger/Debugger-Symbols.h index dc47a6303..5c6e364a8 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-Symbols.h +++ b/Source/Project64/UserInterface/Debugger/Debugger-Symbols.h @@ -2,7 +2,7 @@ #include "DebuggerUI.h" -// todo maybe add char* ownerName and use a TreeView +// TODO: Maybe add char* ownerName and use a TreeView class CDebugSymbols : public CDebugDialog, From 9ec67ea6f5f978823c23ab1cebc036dee55d33b6 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:36:13 -0500 Subject: [PATCH 20/42] Update Debugger-ViewMemory.h Remove extra line --- Source/Project64/UserInterface/Debugger/Debugger-ViewMemory.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-ViewMemory.h b/Source/Project64/UserInterface/Debugger/Debugger-ViewMemory.h index 3e2c787de..570481aa6 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-ViewMemory.h +++ b/Source/Project64/UserInterface/Debugger/Debugger-ViewMemory.h @@ -277,4 +277,3 @@ private: TOOLTIP(IDC_CHK_VADDR, "Checked = Use virtual address space (CPU), Unchecked = Use physical address space (RCP)") END_TOOLTIP_MAP() }; - From 3e9ea5be8cfee40b152a836f61970bf2049fd082 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:37:12 -0500 Subject: [PATCH 21/42] Update DebuggerUI.h Add newline --- Source/Project64/UserInterface/Debugger/DebuggerUI.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/DebuggerUI.h b/Source/Project64/UserInterface/Debugger/DebuggerUI.h index 893dc7b4a..9102e4ae3 100644 --- a/Source/Project64/UserInterface/Debugger/DebuggerUI.h +++ b/Source/Project64/UserInterface/Debugger/DebuggerUI.h @@ -16,4 +16,4 @@ #include "Debugger-CPULogView.h" #include "Debugger-StackView.h" #include "Debugger-StackTrace.h" -#include "Debugger-ExceptionBreakpoints.h" \ No newline at end of file +#include "Debugger-ExceptionBreakpoints.h" From de2b88ca7e950b6d28b63fb1dab3f742102acba7 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:37:19 -0500 Subject: [PATCH 22/42] Update DMALog.cpp Add newline --- Source/Project64/UserInterface/Debugger/DMALog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/DMALog.cpp b/Source/Project64/UserInterface/Debugger/DMALog.cpp index ee457a89b..924d29300 100644 --- a/Source/Project64/UserInterface/Debugger/DMALog.cpp +++ b/Source/Project64/UserInterface/Debugger/DMALog.cpp @@ -98,4 +98,4 @@ DMALOGENTRY* CDMALog::GetEntryByRomAddress(uint32_t romAddr, uint32_t* lpRamAddr *lpRamAddr = lpEntry->ramAddr + *lpOffset; return lpEntry; -} \ No newline at end of file +} From 314efb2da6c063217ff0601e0ceda6e506d044c6 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:37:26 -0500 Subject: [PATCH 23/42] Update DMALog.h Add newline --- Source/Project64/UserInterface/Debugger/DMALog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/DMALog.h b/Source/Project64/UserInterface/Debugger/DMALog.h index 6af6b1fa6..0d404d2ae 100644 --- a/Source/Project64/UserInterface/Debugger/DMALog.h +++ b/Source/Project64/UserInterface/Debugger/DMALog.h @@ -23,4 +23,4 @@ public: DMALOGENTRY* GetEntryByRamAddress(uint32_t ramAddr, uint32_t* lpRomAddr, uint32_t* lpOffset); DMALOGENTRY* GetEntryByRomAddress(uint32_t romAddr); DMALOGENTRY* GetEntryByRomAddress(uint32_t romAddr, uint32_t* lpRamAddr, uint32_t* lpOffset); -}; \ No newline at end of file +}; From e6b9802a60ea59acd627457c4f34dc4ae585e094 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:37:36 -0500 Subject: [PATCH 24/42] Update ScriptHook.cpp Add newline --- Source/Project64/UserInterface/Debugger/ScriptHook.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/ScriptHook.cpp b/Source/Project64/UserInterface/Debugger/ScriptHook.cpp index 1aaa4eba2..57c0f0387 100644 --- a/Source/Project64/UserInterface/Debugger/ScriptHook.cpp +++ b/Source/Project64/UserInterface/Debugger/ScriptHook.cpp @@ -176,4 +176,4 @@ CScriptHook::CScriptHook(CScriptSystem* scriptSystem) CScriptHook::~CScriptHook() { m_Callbacks.clear(); -} \ No newline at end of file +} From ae24c9e1e4c42bc0a6faab33041a879a0bf8062d Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:37:50 -0500 Subject: [PATCH 25/42] Update ScriptHook.h Change multiline comments into single line comments --- Source/Project64/UserInterface/Debugger/ScriptHook.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/ScriptHook.h b/Source/Project64/UserInterface/Debugger/ScriptHook.h index 4e25a8abb..b7cebfa8f 100644 --- a/Source/Project64/UserInterface/Debugger/ScriptHook.h +++ b/Source/Project64/UserInterface/Debugger/ScriptHook.h @@ -32,9 +32,9 @@ public: void InvokeAll(); void InvokeById(int callbackId); void InvokeByParam(uint32_t param); - /* invoke if param >= cb.param && param < cb.param2*/ + // invoke if param >= cb.param && param < cb.param2 void InvokeByAddressInRange(uint32_t address); - /* invoke if param >= cb.param && param < cb.param2 && (value & cb.param4) == cb.param3 */ + // invoke if param >= cb.param && param < cb.param2 && (value & cb.param4) == cb.param3 void InvokeByAddressInRange_MaskedOpcode(uint32_t pc, uint32_t value); void InvokeByAddressInRange_GPRValue(uint32_t pc); void RemoveById(int callbackId); From e64c00b49e27702f6efd8f5b9013fc300b4e049c Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:38:06 -0500 Subject: [PATCH 26/42] Update ScriptSystem.cpp Fix capitalization --- Source/Project64/UserInterface/Debugger/ScriptSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/ScriptSystem.cpp b/Source/Project64/UserInterface/Debugger/ScriptSystem.cpp index 592b7a944..92ab8e8a1 100644 --- a/Source/Project64/UserInterface/Debugger/ScriptSystem.cpp +++ b/Source/Project64/UserInterface/Debugger/ScriptSystem.cpp @@ -62,7 +62,7 @@ void CScriptSystem::RunScript(const char * path) { CGuard guard(m_CS); CScriptInstance* scriptInstance = new CScriptInstance(m_Debugger); - char* pathSaved = (char*)malloc(strlen(path)+1); // freed via DeleteStoppedInstances + char* pathSaved = (char*)malloc(strlen(path)+1); // Freed via DeleteStoppedInstances strcpy(pathSaved, path); m_RunningInstances.push_back({ pathSaved, scriptInstance }); From f8028922773338851e7e98dd27cb57325d23b972 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:39:02 -0500 Subject: [PATCH 27/42] Update ScriptSystem.h Fix capitalization and add newline --- Source/Project64/UserInterface/Debugger/ScriptSystem.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/ScriptSystem.h b/Source/Project64/UserInterface/Debugger/ScriptSystem.h index db661d0a1..ef764bc7e 100644 --- a/Source/Project64/UserInterface/Debugger/ScriptSystem.h +++ b/Source/Project64/UserInterface/Debugger/ScriptSystem.h @@ -49,7 +49,7 @@ private: CriticalSection m_CS; - void RegisterHook(const char* hookId, CScriptHook* cbList); // associate string id with callback list + void RegisterHook(const char* hookId, CScriptHook* cbList); // Associate string ID with callback list void UnregisterHooks(); HDC m_ScreenDC; @@ -133,4 +133,4 @@ public: { return m_HookFrameDrawn; } -}; \ No newline at end of file +}; From 743158c37bf7d71c041a72f32eefac173d17151a Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:39:09 -0500 Subject: [PATCH 28/42] Update Symbols.h Add newline --- Source/Project64/UserInterface/Debugger/Symbols.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/Symbols.h b/Source/Project64/UserInterface/Debugger/Symbols.h index c6626dc3f..c967352cb 100644 --- a/Source/Project64/UserInterface/Debugger/Symbols.h +++ b/Source/Project64/UserInterface/Debugger/Symbols.h @@ -176,4 +176,4 @@ public: { return CSymbolTable::GetTypeSize(m_Type); } -}; \ No newline at end of file +}; From 949f99c4153965de54d9eacdf6bb97679881359e Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:40:19 -0500 Subject: [PATCH 29/42] Update Debugger-DMALogView.cpp Fix capitalization, add a line, add newline --- .../UserInterface/Debugger/Debugger-DMALogView.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-DMALogView.cpp b/Source/Project64/UserInterface/Debugger/Debugger-DMALogView.cpp index 2e039f468..77963e1d1 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-DMALogView.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-DMALogView.cpp @@ -35,6 +35,7 @@ bool CDebugDMALogView::FilterEntry(int dmaLogIndex) return true; } */ + void CDebugDMALogView::RefreshList() { if (g_Rom == NULL) @@ -105,7 +106,7 @@ void CDebugDMALogView::RefreshList() sig.u32 = _byteswap_ulong(*(uint32_t*)&rom[lpEntry->romAddr]); } - // Todo checkbox to display all in hex + // TODO: checkbox to display all in hex if (isalnum(sig.sz[0]) && isalnum(sig.sz[1]) && isalnum(sig.sz[2]) && isalnum(sig.sz[3])) { m_DMAList.AddItem(itemIndex, 4, stdstr((char*)sig.sz).ToUTF16().c_str()); @@ -392,7 +393,7 @@ LRESULT CDebugDMALogView::OnCustomDrawList(NMHDR* pNMHDR) DMALOGENTRY* lpEntry = m_DMALog->GetEntryByIndex(nItem); - if (nItem >= 1) // continuation + if (nItem >= 1) // Continuation { DMALOGENTRY* lpPrevEntry = m_DMALog->GetEntryByIndex(nItem - 1); @@ -403,7 +404,7 @@ LRESULT CDebugDMALogView::OnCustomDrawList(NMHDR* pNMHDR) } } - if (nEntries >= 2 && nItem <= nEntries - 2) // head + if (nEntries >= 2 && nItem <= nEntries - 2) // Head { DMALOGENTRY* lpNextEntry = m_DMALog->GetEntryByIndex(nItem + 1); @@ -415,4 +416,4 @@ LRESULT CDebugDMALogView::OnCustomDrawList(NMHDR* pNMHDR) } return CDRF_DODEFAULT; -} \ No newline at end of file +} From 8ba0e0a427d7157f6899fa630aa30b0beebd5cb8 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:40:52 -0500 Subject: [PATCH 30/42] Update Debugger-Symbols.cpp Fix capitalization, fix TODO comment --- .../Project64/UserInterface/Debugger/Debugger-Symbols.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-Symbols.cpp b/Source/Project64/UserInterface/Debugger/Debugger-Symbols.cpp index ca4b55010..e4e2eb130 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-Symbols.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-Symbols.cpp @@ -119,7 +119,7 @@ LRESULT CDebugSymbols::OnListDblClicked(NMHDR* pNMHDR) int nSelectedCol = -1; - // hit test for column + // Hit test for column POINT mousePt; RECT listRect; @@ -153,11 +153,11 @@ LRESULT CDebugSymbols::OnListDblClicked(NMHDR* pNMHDR) { case SymbolsListView_Col_Address: // Open it in memory viewer/commands viewer - if (symbol.m_Type == SYM_CODE) // code + if (symbol.m_Type == SYM_CODE) // Code { m_Debugger->Debug_ShowCommandsLocation(symbol.m_Address, true); } - else // data/number + else // Data/number { m_Debugger->Debug_ShowMemoryLocation(symbol.m_Address, true); } @@ -167,7 +167,7 @@ LRESULT CDebugSymbols::OnListDblClicked(NMHDR* pNMHDR) { ValueType t = (ValueType)m_SetValueDlg.GetEnteredData(); - //Is there a better way? + // TODO: Is there a better way? m_Debugger->SymbolTable()->RemoveSymbolById(id); m_Debugger->SymbolTable()->AddSymbol(t, symbol.m_Address, symbol.m_Name, symbol.m_Description); } From 3c23dd77e22a9aef61328a96fb4ad0b61d6ac2df Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:42:57 -0500 Subject: [PATCH 31/42] Update Assembler.cpp Fix capitalization, and change some wording --- .../Project64/UserInterface/Debugger/Assembler.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/Assembler.cpp b/Source/Project64/UserInterface/Debugger/Assembler.cpp index 1317d6628..d9745a3d6 100644 --- a/Source/Project64/UserInterface/Debugger/Assembler.cpp +++ b/Source/Project64/UserInterface/Debugger/Assembler.cpp @@ -132,7 +132,7 @@ const ASM_INSTRUCTION CAssembler::m_Instructions[] = { "daddu", R4300i_SPECIAL_DADDU, base_spec, syn_arith }, { "dsub", R4300i_SPECIAL_DSUB, base_spec, syn_arith }, { "dsubu", R4300i_SPECIAL_DSUBU, base_spec, syn_arith }, - { "tge", R4300i_SPECIAL_TGE, base_spec, syn_arith2 }, // note: no code field + { "tge", R4300i_SPECIAL_TGE, base_spec, syn_arith2 }, // Note: no code field { "tgeu", R4300i_SPECIAL_TGEU, base_spec, syn_arith2 }, // { "tlt", R4300i_SPECIAL_TLT, base_spec, syn_arith2 }, // { "tltu", R4300i_SPECIAL_TLTU, base_spec, syn_arith2 }, // @@ -310,8 +310,8 @@ bool CAssembler::AssembleLine(const char* line, uint32_t* opcode, uint32_t addre char* name = strtok_s(line_c, " \t", &m_TokContext); - // attempt to assemble the line - // if a syntax error occurs, check if the command has alternative syntax forms and retry + // Attempt to assemble the line + // If a syntax error occurs, check if the command has alternative syntax forms and retry for(int nFallback = 0;; nFallback++) { @@ -327,7 +327,7 @@ bool CAssembler::AssembleLine(const char* line, uint32_t* opcode, uint32_t addre if (nFallback > 0) { - // prepare for re-tokenization + // Prepare for re-tokenization strncpy(line_c, line, 128); StrToLower(line_c); name = strtok_s(line_c, " \t", &m_TokContext); @@ -351,7 +351,7 @@ bool CAssembler::AssembleLine(const char* line, uint32_t* opcode, uint32_t addre } } - // assembled without errors + // Assembled without errors return true; next_fallback:; @@ -436,11 +436,11 @@ uint32_t CAssembler::pop_val() // return 0; //} - int base = 0; // hex or dec + int base = 0; // Hexadecimal or decimal if (*v == '$') { - base = 16; // hex + base = 16; // Hexadecimal v++; } From 848f6bfdcf830e46023914586d2e8c81ef14d455 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:43:39 -0500 Subject: [PATCH 32/42] Update ScriptInstance.h Fix capitalization, add some TODO comments, add newline --- .../UserInterface/Debugger/ScriptInstance.h | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/ScriptInstance.h b/Source/Project64/UserInterface/Debugger/ScriptInstance.h index 6ea316677..def6b543b 100644 --- a/Source/Project64/UserInterface/Debugger/ScriptInstance.h +++ b/Source/Project64/UserInterface/Debugger/ScriptInstance.h @@ -13,9 +13,9 @@ class CScriptSystem; typedef enum { - STATE_STARTED, // initial evaluation & execution - STATE_RUNNING, // event loop running with pending events - STATE_STOPPED, // no pending events + STATE_STARTED, // Initial evaluation and execution + STATE_RUNNING, // Event loop running with pending events + STATE_STOPPED, // No pending events STATE_INVALID } INSTANCE_STATE; @@ -32,11 +32,11 @@ class CScriptInstance OVERLAPPED ovl; IOEVENTTYPE eventType; HANDLE fd; - HANDLE childFd; // accepted socket + HANDLE childFd; // Accepted socket bool bSocket; UINT id; void* data; - DWORD dataLen; // changed to bytes transferred after event is fired + DWORD dataLen; // Changed to bytes transferred after event is fired void* callback; } IOLISTENER; @@ -122,14 +122,15 @@ private: //static void CALLBACK EvalAsyncCallback(ULONG_PTR evalWait); - bool AddFile(const char* path, const char* mode, int* fd); // return fd + bool AddFile(const char* path, const char* mode, int* fd); // Return FD void CloseFile(int fd); FILE* GetFilePointer(int fd); void CloseAllFiles(); const char* EvalFile(const char* jsPath); - // Handle to to dynamically load CancelIoEx for Windows XP compatibility + // TODO: fix/remove? + // Handle dynamically loading CancelIoEx for Windows XP compatibility HMODULE m_hKernel; Dynamic_CancelIoEx m_CancelIoEx; @@ -146,7 +147,7 @@ private: static duk_ret_t js_ioSockConnect(duk_context*); // async static duk_ret_t js_ioRead(duk_context*); // async static duk_ret_t js_ioWrite(duk_context*); // async - static duk_ret_t js_ioClose(duk_context*); // (fd) ; file or socket + static duk_ret_t js_ioClose(duk_context*); // (FD) ; file or socket static duk_ret_t js_MsgBox(duk_context*); // (message, caption) static duk_ret_t js_AddCallback(duk_context*); // (hookId, callback, tag) ; external events static duk_ret_t js_RemoveCallback(duk_context*); // (callbackId) @@ -177,8 +178,8 @@ private: static duk_ret_t js_ConsoleClear(duk_context*); static duk_ret_t js_BreakHere(duk_context*); - static duk_ret_t js_Pause(duk_context*); // () ; pauses emulation - static duk_ret_t js_ShowCommands(duk_context*); // ([address]) ; shows commands window + static duk_ret_t js_Pause(duk_context*); // () ; Pauses emulation + static duk_ret_t js_ShowCommands(duk_context*); // ([address]) ; Shows commands window static duk_ret_t js_ScreenPrint(duk_context*); // (x, y, text) @@ -252,4 +253,4 @@ private: { "fsReadDir", js_FSReadDir, DUK_VARARGS }, { NULL, NULL, 0 } }; -}; \ No newline at end of file +}; From 5bf2a3bfb605e108383354a584cce326c9c71bc6 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:45:29 -0500 Subject: [PATCH 33/42] Update Debugger-Commands.cpp Fix capitalization, adjust some wording, add TODO comments, add punctuation, add newline --- .../Debugger/Debugger-Commands.cpp | 73 ++++++++++--------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-Commands.cpp b/Source/Project64/UserInterface/Debugger/Debugger-Commands.cpp index e227d67de..e7db0302b 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-Commands.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-Commands.cpp @@ -91,7 +91,7 @@ LRESULT CDebugCommandsView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARA m_bIgnorePCChange = true; m_PCEdit.SetValue(0x80000180, DisplayMode::ZeroExtend); - // Setup View PC button + // Setup view PC button m_ViewPCButton.EnableWindow(FALSE); m_StepButton.EnableWindow(FALSE); m_StepOverButton.EnableWindow(FALSE); @@ -162,6 +162,7 @@ void CDebugCommandsView::RecompilerCheck(void) !g_Settings->LoadBool(Setting_ForceInterpreterCPU) && (CPU_TYPE)g_Settings->LoadDword(Game_CpuType) != CPU_Interpreter) { + // TODO: Remove this or fix? MessageBox(L"Debugger support for the recompiler core is experimental.\n\n" L"For optimal experience, enable \"Always use interpreter core\" " L"in advanced settings and restart the emulator.", @@ -259,7 +260,7 @@ void CDebugCommandsView::AddBranchArrow(int startPos, int endPos) { BRANCHARROW arrow = m_BranchArrows[j]; - // Arrow's start or end pos within another arrow's stride + // Arrow's start or end position within another arrow's stride if ((startPos >= arrow.startPos && startPos <= arrow.endPos) || (endPos >= arrow.startPos && endPos <= arrow.endPos) || (arrow.startPos <= startPos && arrow.startPos >= endPos)) @@ -554,7 +555,7 @@ void CDebugCommandsView::ShowAddress(uint32_t address, bool top, bool bUserInput } } - // Detect reads and writes to mapped registers, cart header data, etc + // Detect reads and writes to mapped registers, cart header data, etc. const char* annotation = NULL; bool bLoadStoreAnnotation = false; @@ -648,7 +649,7 @@ void CDebugCommandsView::ShowAddress(uint32_t address, bool top, bool bUserInput } } - if (!top) // update registers when called via breakpoint/stepping + if (!top) // Update registers when called via breakpoint/stepping { m_RegisterTabs.RefreshEdits(); } @@ -693,35 +694,35 @@ LRESULT CDebugCommandsView::OnCustomDrawList(NMHDR* pNMHDR) return CDRF_DODEFAULT; } - if (nSubItem == CCommandList::COL_ADDRESS) // addr + if (nSubItem == CCommandList::COL_ADDRESS) // ADDR { CBreakpoints::BPSTATE bpState = m_Breakpoints->ExecutionBPExists(address); if (bpState == CBreakpoints::BP_SET) { - // breakpoint + // Breakpoint pLVCD->clrTextBk = RGB(0x44, 0x00, 0x00); pLVCD->clrText = (address == pc && isDebugging()) ? - RGB(0xFF, 0xFF, 0x00) : // breakpoint & current pc + RGB(0xFF, 0xFF, 0x00) : // Breakpoint & current PC RGB(0xFF, 0xCC, 0xCC); } else if (bpState == CBreakpoints::BP_SET_TEMP) { - // breakpoint + // Breakpoint pLVCD->clrTextBk = RGB(0x66, 0x44, 0x00); pLVCD->clrText = (address == pc && isDebugging()) ? - RGB(0xFF, 0xFF, 0x00) : // breakpoint & current pc + RGB(0xFF, 0xFF, 0x00) : // Breakpoint & current PC RGB(0xFF, 0xEE, 0xCC); } else if (address == pc && isStepping()) { - // pc + // PC pLVCD->clrTextBk = RGB(0x88, 0x88, 0x88); pLVCD->clrText = RGB(0xFF, 0xFF, 0); } else { - //default + // Default pLVCD->clrTextBk = RGB(0xEE, 0xEE, 0xEE); pLVCD->clrText = RGB(0x44, 0x44, 0x44); } @@ -730,7 +731,7 @@ LRESULT CDebugCommandsView::OnCustomDrawList(NMHDR* pNMHDR) // (nSubItem == 1 || nSubItem == 2) - // cmd & args + // Command and arguments COpInfo OpInfo; OPCODE& OpCode = OpInfo.m_OpCode; bool bAddrOkay = m_Debugger->DebugLoad_VAddr(address, OpCode.Hex); @@ -794,10 +795,10 @@ LRESULT CDebugCommandsView::OnCustomDrawList(NMHDR* pNMHDR) return CDRF_DODEFAULT; } - // color register usage - // todo localise to temp register context (dont look before/after jumps and frame shifts) - COLORREF clrUsedRegister = RGB(0xF5, 0xF0, 0xFF); // light purple - COLORREF clrAffectedRegister = RGB(0xFF, 0xF0, 0xFF); // light pink + // Color register usage + // TODO: localize to temp register context (don't look before/after jumps and frame shifts) + COLORREF clrUsedRegister = RGB(0xF5, 0xF0, 0xFF); // Light purple + COLORREF clrAffectedRegister = RGB(0xFF, 0xF0, 0xFF); // Light pink int pcUsedRegA = 0, pcUsedRegB = 0, pcChangedReg = 0; int curUsedRegA = 0, curUsedRegB = 0, curChangedReg = 0; @@ -865,16 +866,16 @@ void CDebugCommandsView::DrawBranchArrows(HDC listDC) { COLORREF colors[] = { - RGB(240, 240, 240), // white - RGB(30, 135, 255), // blue - RGB(255, 0, 200), // pink - RGB(215, 155, 0), // yellow - RGB(100, 180, 0), // green - RGB(200, 100, 255), // purple - RGB(120, 120, 120), // gray - RGB(0, 220, 160), // cyan - RGB(255, 100, 0), // orange - RGB(255, 255, 0), // yellow + RGB(240, 240, 240), // White + RGB(30, 135, 255), // Blue + RGB(255, 0, 200), // Pink + RGB(215, 155, 0), // Yellow + RGB(100, 180, 0), // Green + RGB(200, 100, 255), // Purple + RGB(120, 120, 120), // Gray + RGB(0, 220, 160), // Cyan + RGB(255, 100, 0), // Orange + RGB(255, 255, 0), // Yellow }; int nColors = sizeof(colors) / sizeof(COLORREF); @@ -930,13 +931,13 @@ void CDebugCommandsView::DrawBranchArrows(HDC listDC) int marginX = baseX - (4 + arrow.margin * 3); - // draw start pointer + // Draw start pointer SetPixel(listDC, begX + 0, begY - 1, color); SetPixel(listDC, begX + 1, begY - 2, color); SetPixel(listDC, begX + 0, begY + 1, color); SetPixel(listDC, begX + 1, begY + 2, color); - // draw outline + // Draw outline CPen hPenOutline(CreatePen(PS_SOLID, 3, bgColor)); SelectObject(listDC, hPenOutline); MoveToEx(listDC, begX - 1, begY, NULL); @@ -947,7 +948,7 @@ void CDebugCommandsView::DrawBranchArrows(HDC listDC) LineTo(listDC, endX + 2, endY); } - // draw fill line + // Draw fill line CPen hPen(CreatePen(PS_SOLID, 1, color)); SelectObject(listDC, hPen); MoveToEx(listDC, begX - 1, begY, NULL); @@ -958,7 +959,7 @@ void CDebugCommandsView::DrawBranchArrows(HDC listDC) LineTo(listDC, endX + 2, endY); } - // draw end pointer + // Draw end pointer if (bEndVisible) { SetPixel(listDC, endX - 0, endY - 1, color); @@ -1061,13 +1062,13 @@ void CDebugCommandsView::CPUStepOver() if (opInfo.IsJAL()) { - // put temp BP on return address and resume + // Put temp BP on return address and resume m_Breakpoints->AddExecution(g_Reg->m_PROGRAM_COUNTER + 8, true); CPUResume(); } else { - // normal step + // Normal step if (WaitingForStep()) { m_StepEvent.Trigger(); @@ -1114,7 +1115,7 @@ LRESULT CDebugCommandsView::OnSymbolsButton(WORD /*wNotifyCode*/, WORD /*wID*/, LRESULT CDebugCommandsView::OnPopupmenuRunTo(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/) { - // Add temp bp and resume + // Add temp BP and resume m_Breakpoints->AddExecution(m_SelectedAddress, true); return FALSE; } @@ -1491,7 +1492,7 @@ void CDebugCommandsView::RedrawCommandsAndRegisters() m_RegisterTabs.RedrawCurrentTab(); - // Fix cmd list header + // Fix command list header listHead.ResizeClient(listRect.Width(), headRect.Height()); } @@ -1698,7 +1699,7 @@ LRESULT CDebugCommandsView::OnOpEditKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM LRESULT CDebugCommandsView::OnOpEditChanged(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/) { - // handle multiline input + // Handle multiline input size_t length = m_OpEdit.GetWindowTextLength(); wchar_t* text = new wchar_t[length + 1]; m_OpEdit.GetWindowText(text, length + 1); @@ -1770,4 +1771,4 @@ void CEditOp::SetCommandsWindow(CDebugCommandsView* commandsWindow) BOOL CEditOp::Attach(HWND hWndNew) { return SubclassWindow(hWndNew); -} \ No newline at end of file +} From 85f8eb31a64c7e0abb58578989e11ba8bc92a3c1 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:49:03 -0500 Subject: [PATCH 34/42] Update Debugger-RegisterTabs.cpp Fix capitalization, add newline --- .../Debugger/Debugger-RegisterTabs.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabs.cpp b/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabs.cpp index 2afc5d788..f9e5f2d69 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabs.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabs.cpp @@ -297,7 +297,7 @@ void CRegisterTabs::RegisterChanged(HWND hDlg, TAB_ID srcTabId, WPARAM wParam) uint32_t value = wcstoul(text, NULL, 16); wsprintf(text, L"%08X", value); - editCtrl.SetWindowText(text); // reformat text + editCtrl.SetWindowText(text); // Reformat text if (srcTabId == TabFPR) { @@ -468,7 +468,7 @@ INT_PTR CALLBACK CRegisterTabs::TabProcGPR(HWND hDlg, UINT msg, WPARAM wParam, L return TRUE; } - // color textboxes + // Color textboxes if (msg == WM_CTLCOLOREDIT) { HDC hdc = (HDC)wParam; @@ -549,7 +549,7 @@ INT_PTR CALLBACK CRegisterTabs::TabProcGPR(HWND hDlg, UINT msg, WPARAM wParam, L return FALSE; } - // right click labels + // Right click labels if (msg == WM_CONTEXTMENU) { if (m_Debugger == NULL) @@ -574,7 +574,7 @@ INT_PTR CALLBACK CRegisterTabs::TabProcGPR(HWND hDlg, UINT msg, WPARAM wParam, L { int nReg = TabData::GPR.GetLabelIndex(ctrlId); - if (nReg <= 0) // ignore R0 + if (nReg <= 0) // Ignore R0 { return FALSE; } @@ -586,7 +586,7 @@ INT_PTR CALLBACK CRegisterTabs::TabProcGPR(HWND hDlg, UINT msg, WPARAM wParam, L return FALSE; } - // click labels + // Click labels if (msg == WM_COMMAND && HIWORD(wParam) == STN_CLICKED || HIWORD(wParam) == STN_DBLCLK) { if (m_Debugger == NULL) @@ -611,7 +611,7 @@ INT_PTR CALLBACK CRegisterTabs::TabProcGPR(HWND hDlg, UINT msg, WPARAM wParam, L { int nReg = TabData::GPR.GetLabelIndex(ctrlId); - if (nReg <= 0) // ignore R0 + if (nReg <= 0) // Ignore R0 { return FALSE; } @@ -623,7 +623,7 @@ INT_PTR CALLBACK CRegisterTabs::TabProcGPR(HWND hDlg, UINT msg, WPARAM wParam, L return FALSE; } - // color labels + // Color labels if (msg == WM_CTLCOLORSTATIC) { if (m_Debugger == NULL) @@ -1036,7 +1036,7 @@ stdstr CEditReg64::GetValueText() LRESULT CEditReg64::OnLostFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) { - SetValue(GetValue()); // clean up + SetValue(GetValue()); // Clean up bHandled = FALSE; return 0; } @@ -1053,4 +1053,4 @@ void CEditReg64::SetValue(uint64_t value) uint32_t h = (value & 0xFFFFFFFF00000000LL) >> 32; uint32_t l = (value & 0x00000000FFFFFFFFLL); SetValue(h, l); -} \ No newline at end of file +} From d9dbd775337324bfa7bfd398b09318c2d323840d Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:50:07 -0500 Subject: [PATCH 35/42] Update Debugger-ViewMemory.cpp Fix capitalization, add and fix some TODO comments --- .../UserInterface/Debugger/Debugger-ViewMemory.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-ViewMemory.cpp b/Source/Project64/UserInterface/Debugger/Debugger-ViewMemory.cpp index 13a75a1e3..373351678 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-ViewMemory.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-ViewMemory.cpp @@ -567,11 +567,11 @@ LRESULT CDebugMemoryView::OnHxCtrlKeyPressed(LPNMHDR lpNMHDR) m_Breakpoints->ClearMemLocks(); break; case 'F': - // todo put selection in the textbox + // TODO: put selection in the textbox m_Debugger->OpenMemorySearch(); break; case 'S': - // todo set start and end addrs to selection + // TODO: set start and end address to selection m_Debugger->OpenMemoryDump(); break; case 'T': @@ -786,8 +786,8 @@ LRESULT CDebugMemoryView::OnHxGetByteInfo(LPNMHDR lpNMHDR) continue; } - // always use virtual addresses for breakpoint & symbol info - // todo should be the other way around + // Always use virtual addresses for breakpoint and symbol info + // TODO: should be the other way around uint32_t vaddress = m_bVirtualMemory ? address : address + 0x80000000; CSymbol symbol; @@ -938,7 +938,7 @@ LRESULT CDebugMemoryView::OnHxHotAddrChanged(LPNMHDR /*lpNMHDR*/) LRESULT CDebugMemoryView::OnHxBaseAddrChanged(LPNMHDR /*lpNMHDR*/) { - // address was updated from the control + // Address was updated from the control uint32_t address = m_HexEditCtrl.GetBaseAddress(); m_bIgnoreAddressInput = true; m_MemAddr.SetValue(address, DisplayMode::ZeroExtend); @@ -973,7 +973,7 @@ LRESULT CDebugMemoryView::OnHxPaste(LPNMHDR lpNMHDR) if (nmp->column == HX_COL_HEXDATA) { char* data = NULL; - // todo move this function to some utility class + // TODO: move this function to some utility class int length = CMemoryScanner::ParseHexString(NULL, text); if (length != 0) @@ -1143,7 +1143,7 @@ void CDebugMemoryView::CloseTab(int nItem) { if (nItem == m_TabCtrl.GetItemCount() - 1) { - // last tab + // Last tab m_TabCtrl.SetCurSel(nItem - 1); } else if (nItem == nSelItem) From b7d1c1d37911c564126a962efcbc07b0d70aa3a4 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:50:34 -0500 Subject: [PATCH 36/42] Update Debugger.cpp Fix capitalization, Fix TODO comment --- .../UserInterface/Debugger/Debugger.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger.cpp b/Source/Project64/UserInterface/Debugger/Debugger.cpp index 9e61ae469..2b9559544 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger.cpp @@ -457,7 +457,7 @@ void CDebuggerUI::TLBChanged() Debug_RefreshTLBWindow(); } -// Exception handling - break on exception vector if exception bp is set +// Exception handling - break on exception vector if exception BP is set void CDebuggerUI::HandleCPUException(void) { int exc = (g_Reg->CAUSE_REGISTER >> 2) & 0x1F; @@ -467,7 +467,7 @@ void CDebuggerUI::HandleCPUException(void) if ((ExceptionBreakpoints() & (1 << exc))) { - if (exc == 15) // floating-point exception + if (exc == 15) // Floating-point exception { if (fpExc & FpExceptionBreakpoints()) { @@ -475,7 +475,7 @@ void CDebuggerUI::HandleCPUException(void) } return; } - else if (exc == 0) // interrupt exception + else if (exc == 0) // Interrupt exception { if (intr & IntrBreakpoints()) { @@ -487,14 +487,14 @@ void CDebuggerUI::HandleCPUException(void) } return; } - else // other interrupts + else // Other interrupts { goto have_bp; } } return; } - else // other exceptions + else // Other exceptions { goto have_bp; } @@ -522,7 +522,7 @@ void CDebuggerUI::HandleCartToRamDMA(void) m_DMALog->AddEntry(dmaRomAddr, dmaRamAddr, dmaLen); Debug_RefreshDMALogWindow(); - // break if write breakpoint exists anywhere in target buffer + // Break if write breakpoint exists anywhere in target buffer if (m_Breakpoints->WriteBPExistsInChunk(dmaRamAddr, dmaLen)) { g_Settings->SaveBool(Debugger_SteppingOps, true); @@ -586,7 +586,7 @@ void CDebuggerUI::CPUStepStarted() if (pc == 0x80000000 || pc == 0x80000080 || pc == 0xA0000100 || pc == 0x80000180) { - if ((g_Reg->STATUS_REGISTER >> 1) & 3) // if exl/erl bits are set + if ((g_Reg->STATUS_REGISTER >> 1) & 3) // If EXL/ERL bits are set { HandleCPUException(); } @@ -657,7 +657,7 @@ void CDebuggerUI::CPUStepEnded() { m_StackTrace->PopEntry(); } - else if (op == R4300i_CP0 && funct == R4300i_COP0_CO_ERET) // TODO may need more work + else if (op == R4300i_CP0 && funct == R4300i_COP0_CO_ERET) // TODO: may need more work { m_StackTrace->ClearEntries(); } From 39dc60e1a55085c5ac3cf6dfebe1d4bdeb432aed Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:51:05 -0500 Subject: [PATCH 37/42] Update DebugMMU.cpp Fix capitalization, fix abbreviations --- Source/Project64/UserInterface/Debugger/DebugMMU.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/DebugMMU.cpp b/Source/Project64/UserInterface/Debugger/DebugMMU.cpp index 94fbd4de3..ea7391a65 100644 --- a/Source/Project64/UserInterface/Debugger/DebugMMU.cpp +++ b/Source/Project64/UserInterface/Debugger/DebugMMU.cpp @@ -21,7 +21,7 @@ uint8_t* CDebugMMU::GetPhysicalPtr(uint32_t paddr, WORD* flags) bool bCartRom = false; if ((paddr < g_MMU->RdramSize()) || - (paddr >= 0x04000000 && paddr <= 0x04001FFF)) // RDRAM & DMEM/IMEM + (paddr >= 0x04000000 && paddr <= 0x04001FFF)) // RDRAM and DMEM/IMEM { ptr = (uint8_t*)(g_MMU->Rdram() + paddr); } @@ -55,7 +55,7 @@ uint8_t* CDebugMMU::GetPhysicalPtr(uint32_t paddr, WORD* flags) } else { - // note: write-only registers are excluded + // Note: write-only registers are excluded switch (paddr) { case 0x03F00000: ptr = (uint8_t*)&g_Reg->RDRAM_CONFIG_REG; break; @@ -176,7 +176,7 @@ bool CDebugMMU::GetPhysicalByte(uint32_t paddr, uint8_t* value) { uint32_t saveOffset = paddr & 0x000FFFFF; - if (g_System->m_SaveUsing == SaveChip_Sram && saveOffset <= 0x7FFF) // sram + if (g_System->m_SaveUsing == SaveChip_Sram && saveOffset <= 0x7FFF) // SRAM { uint32_t wordpaddr = paddr & ~3; uint8_t data[4]; @@ -186,7 +186,7 @@ bool CDebugMMU::GetPhysicalByte(uint32_t paddr, uint8_t* value) *value = data[nByte ^ 3]; return true; } - else if (g_System->m_SaveUsing == SaveChip_FlashRam && saveOffset <= 3) // flash ram status + else if (g_System->m_SaveUsing == SaveChip_FlashRam && saveOffset <= 3) // Flash RAM status { CFlashram* flashRam = g_MMU->GetFlashram(); uint32_t flashStatus = flashRam->ReadFromFlashStatus(0x08000000); From bc6de64ae4f0a2e9aa52ddb772fc560282ba6224 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:51:36 -0500 Subject: [PATCH 38/42] Update MemoryScanner.cpp Fix capitalization, remove a comment --- .../UserInterface/Debugger/MemoryScanner.cpp | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/MemoryScanner.cpp b/Source/Project64/UserInterface/Debugger/MemoryScanner.cpp index ab4edfc14..b2d2d7192 100644 --- a/Source/Project64/UserInterface/Debugger/MemoryScanner.cpp +++ b/Source/Project64/UserInterface/Debugger/MemoryScanner.cpp @@ -298,7 +298,7 @@ uint32_t CScanResult::GetVirtualAddress(void) } else { - // convert physical to virtual kseg0 + // Convert physical to virtual kseg0 return (m_Address | 0x80000000); } } @@ -470,9 +470,6 @@ bool CScanResult::SetStrLengthSafe(int length) // m_bSelected = bSelected; //} - -/*********************/ - CMemoryScanner::CMemoryScanner(void) : m_DidFirstScan(false), m_ValueType(ValueType_uint8), @@ -550,13 +547,13 @@ bool CMemoryScanner::SetAddressRange(uint32_t startAddress, uint32_t endAddress) { m_VAddrBits = startAddress & 0xE0000000; - // don't allow TLB + // Don't allow TLB if (!RangeCheck(startAddress, endAddress, 0x80000000, 0xBFFFFFFF)) { return false; } - // use physical addresses internally + // Use physical addresses internally startAddress = startAddress & 0x1FFFFFFF; endAddress = endAddress & 0x1FFFFFFF; } @@ -589,7 +586,7 @@ bool CMemoryScanner::SetAddressRange(uint32_t startAddress, uint32_t endAddress) } else { - return false; // invalid range + return false; // Invalid range } m_Memory = GetMemoryPool(startAddress); @@ -711,7 +708,7 @@ void CMemoryScanner::RemoveResult(size_t index) m_Results.erase(m_Results.begin() + index); } -// scan for text or hex array +// Scan for text or hexadecimal array void CMemoryScanner::FirstScanLoopString(DisplayFormat resultDisplayFormat) { int length = m_StringValueLength; @@ -740,7 +737,7 @@ void CMemoryScanner::FirstScanLoopString(DisplayFormat resultDisplayFormat) } } -// scan for text (case-insensitive) +// Scan for text (case-insensitive) void CMemoryScanner::FirstScanLoopIString(DisplayFormat resultDisplayFormat) { int length = m_StringValueLength; @@ -769,7 +766,7 @@ void CMemoryScanner::FirstScanLoopIString(DisplayFormat resultDisplayFormat) } } -// scan for text of unknown single-byte encoding +// Scan for text of unknown single-byte encoding void CMemoryScanner::FirstScanLoopUnkString(void) { const char* str = stdstr().FromUTF16(m_Value._string).c_str(); @@ -921,7 +918,7 @@ bool CMemoryScanner::FirstScan(DisplayFormat resDisplayFormat) #define _NextScanLoopPrimitive64(T, Compare) NextScanLoopPrimitive64(Compare) #define _NextScanLoopPrimitiveResults64(T, Compare) NextScanLoopPrimitiveResults64(Compare) -// compare result's current value in memory against m_Value +// Compare result's current value in memory against m_Value #define NEXT_SCAN_PRIMITIVES_AGAINST_VALUE(CompareFunc) \ switch(m_ValueType) \ { \ @@ -937,7 +934,7 @@ bool CMemoryScanner::FirstScan(DisplayFormat resDisplayFormat) case ValueType_double: _NextScanLoopPrimitive64(double, CompareFunc); break; \ } -// compare result's current value in memory against result's old value +// Compare result's current value in memory against result's old value #define NEXT_SCAN_PRIMITIVES_AGAINST_RESULTS(CompareFunc) \ switch(m_ValueType) \ { \ From acda5a8778106f39615082f9e481f3afca8e1437 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:52:07 -0500 Subject: [PATCH 39/42] Update MemoryScanner.h Fix capitalization, add hyphen for 64-bit --- .../UserInterface/Debugger/MemoryScanner.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/MemoryScanner.h b/Source/Project64/UserInterface/Debugger/MemoryScanner.h index 9064ab15f..caddfe8fa 100644 --- a/Source/Project64/UserInterface/Debugger/MemoryScanner.h +++ b/Source/Project64/UserInterface/Debugger/MemoryScanner.h @@ -15,7 +15,7 @@ enum ValueType ValueType_int64, ValueType_float, ValueType_double, - // non-primitives: + // Non-primitives: ValueType_string, ValueType_istring, ValueType_unkstring @@ -34,10 +34,10 @@ enum SearchType SearchType_GreaterThanValue, SearchType_LessThanOrEqualToValue, SearchType_GreaterThanOrEqualToValue, - // first scan only: + // First scan only: SearchType_UnknownValue, SearchType_JalTo, - // next scan only: + // Next scan only: SearchType_ChangedValue, SearchType_UnchangedValue, SearchType_IncreasedValue, @@ -250,7 +250,7 @@ private: } } - // for int64 and double + // For int64 and double template void FirstScanLoopPrimitive64(bool(*CompareFunc)(T, T), DisplayFormat resultDisplayFormat) { @@ -276,7 +276,7 @@ private: } } - // compare result's current value in memory against m_Value + // Compare result's current value in memory against m_Value template void NextScanLoopPrimitive(bool(*CompareFunc)(T, T)) { @@ -301,7 +301,7 @@ private: m_Results.swap(m_NewResults); } - // compare result's current value in memory against m_Value (for 64 bit types) + // Compare result's current value in memory against m_Value (for 64-bit types) template void NextScanLoopPrimitive64(bool(*CompareFunc)(T, T)) { @@ -328,7 +328,7 @@ private: m_Results.swap(m_NewResults); } - // compare result's current value in memory against result's old value + // Compare result's current value in memory against result's old value template void NextScanLoopPrimitiveResults(bool(*CompareFunc)(T, T)) { @@ -354,7 +354,7 @@ private: m_Results.swap(m_NewResults); } - // compare result's current value in memory against result's old value (for 64 bit types) + // Compare result's current value in memory against result's old value (for 64-bit types) template void NextScanLoopPrimitiveResults64(bool(*CompareFunc)(T, T)) { From 40837a4535db828f6d976d3f2c0bb1da59d9c38b Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:53:41 -0500 Subject: [PATCH 40/42] Update OpInfo.h Fix capitalization, add newline --- Source/Project64/UserInterface/Debugger/OpInfo.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/OpInfo.h b/Source/Project64/UserInterface/Debugger/OpInfo.h index 4cdbb2f6f..9a42ade41 100644 --- a/Source/Project64/UserInterface/Debugger/OpInfo.h +++ b/Source/Project64/UserInterface/Debugger/OpInfo.h @@ -21,7 +21,7 @@ public: bool IsStaticJump() { - // j, jal + // J, JAL uint32_t op = m_OpCode.op; @@ -35,7 +35,7 @@ public: bool IsJump() { - // j, jal, jr, jalr, exception + // J, JAL, JR, JALR, exception uint32_t op = m_OpCode.op; @@ -147,13 +147,13 @@ public: m_OpCode.op >= R4300i_SC && m_OpCode.op <= R4300i_SD); } - // addiu sp, sp, x + // ADDIU SP, SP, X bool IsStackShift() { return (m_OpCode.op == R4300i_ADDIU || m_OpCode.op == R4300i_ADDI) && m_OpCode.rt == 29; } - // addiu sp, sp, + // ADDIU SP, SP, bool IsStackAlloc() { if (!IsStackShift()) @@ -164,7 +164,7 @@ public: return (short)m_OpCode.immediate < 0; } - // addiu sp, sp, + // ADDIU SP, SP, bool IsStackFree() { if (!IsStackShift()) @@ -384,4 +384,4 @@ public: return 4; } } -}; \ No newline at end of file +}; From 38e3b5c75df3213b5d7a023f12c5ec6c55f5aa05 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:54:59 -0500 Subject: [PATCH 41/42] Update ScriptInstance.cpp Fix capitalization, adjust some TODO comments, add punctuation, adjust wording, remove extra comments, add newlines --- .../UserInterface/Debugger/ScriptInstance.cpp | 55 +++++++++---------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/ScriptInstance.cpp b/Source/Project64/UserInterface/Debugger/ScriptInstance.cpp index 21f8bfbdb..884bbc890 100644 --- a/Source/Project64/UserInterface/Debugger/ScriptInstance.cpp +++ b/Source/Project64/UserInterface/Debugger/ScriptInstance.cpp @@ -105,7 +105,7 @@ void CScriptInstance::SetState(INSTANCE_STATE state) void CScriptInstance::StateChanged() { - // todo mutex might be needed here + // TODO: mutex might be needed here m_Debugger->Debug_RefreshScriptsWindow(); //m_ScriptSystem->DeleteStoppedInstances(); @@ -179,7 +179,7 @@ void CScriptInstance::StartEventLoop() { SetState(STATE_RUNNING); - // Todo interrupt with an apc when an event is removed and event count is 0 + // TODO: interrupt with an APC when an event is removed and event count is 0 while (HaveEvents()) { IOLISTENER* lpListener; @@ -300,7 +300,7 @@ void CScriptInstance::CloseAllAsyncFiles() void CScriptInstance::RemoveAsyncFile(HANDLE fd) { - // Stop tracking an fd and remove all of its listeners + // Stop tracking an FD and remove all of its listeners for (uint32_t i = 0; i < m_AsyncFiles.size(); i++) { IOFD iofd = m_AsyncFiles[i]; @@ -357,8 +357,9 @@ void CScriptInstance::RemoveListenerByIndex(UINT index) } else { + // TODO: Remove/fix? // This isn't a good replacement and the script aspects of the debugger shouldn't - // be used in WindowsXP + // be used in Windows XP CancelIo(lpListener->fd); } @@ -367,7 +368,7 @@ void CScriptInstance::RemoveListenerByIndex(UINT index) m_Listeners.erase(m_Listeners.begin() + index); } -// Free listener & its buffer, remove from list +// Free listener & it's buffer, remove from list void CScriptInstance::RemoveListener(IOLISTENER* lpListener) { for (UINT i = 0; i < m_Listeners.size(); i++) @@ -415,19 +416,19 @@ void CScriptInstance::InvokeListenerCallback(IOLISTENER* lpListener) } else { - // handle must have closed, safe to untrack fd and remove all associated listeners + // Handle must have closed, safe to untrack FD and remove all associated listeners RemoveAsyncFile(lpListener->fd); - // pass null to callback + // Pass null to callback duk_push_null(m_Ctx); } break; case EVENT_WRITE: nargs = 1; - duk_push_uint(m_Ctx, lpListener->dataLen); // num bytes written + duk_push_uint(m_Ctx, lpListener->dataLen); // Number of bytes written break; case EVENT_ACCEPT: - // pass client socket fd to callback + // Pass client socket FD to callback nargs = 1; duk_push_uint(m_Ctx, (UINT)lpListener->childFd); break; @@ -585,8 +586,6 @@ void CScriptInstance::QueueAPC(PAPCFUNC userProc, ULONG_PTR param) } } -/****************************/ - duk_ret_t CScriptInstance::js_ioSockConnect(duk_context* ctx) { CScriptInstance* _this = FetchInstance(ctx); @@ -668,7 +667,7 @@ duk_ret_t CScriptInstance::js_ioSockAccept(duk_context* ctx) HANDLE fd = (HANDLE)duk_get_uint(ctx, 0); void* jsCallback = duk_get_heapptr(ctx, 1); - void* data = malloc(sizeof(SOCKADDR) * 4); // issue? + void* data = malloc(sizeof(SOCKADDR) * 4); // Issue? IOLISTENER* lpListener = _this->AddListener(fd, EVENT_ACCEPT, jsCallback, data, 0); @@ -678,7 +677,7 @@ duk_ret_t CScriptInstance::js_ioSockAccept(duk_context* ctx) int ok = AcceptEx( (SOCKET)fd, (SOCKET)lpListener->childFd, - lpListener->data, // local and remote SOCKADDR + lpListener->data, // Local and remote SOCKADDR 0, sizeof(SOCKADDR_IN) + 16, sizeof(SOCKADDR_IN) + 16, @@ -706,7 +705,7 @@ duk_ret_t CScriptInstance::js_ioRead(duk_context* ctx) size_t bufferSize = duk_get_uint(ctx, 1); void* jsCallback = duk_get_heapptr(ctx, 2); - void* data = malloc(bufferSize); // freed after event is fired + void* data = malloc(bufferSize); // Freed after event is fired IOLISTENER* lpListener = _this->AddListener(fd, EVENT_READ, jsCallback, data, bufferSize); BOOL status = ReadFile(fd, lpListener->data, lpListener->dataLen, NULL, (LPOVERLAPPED)lpListener); @@ -729,7 +728,7 @@ duk_ret_t CScriptInstance::js_ioWrite(duk_context* ctx) void* jsData = duk_to_buffer(ctx, 1, &dataLen); void* jsCallback = duk_get_heapptr(ctx, 2); - char* data = (char*)malloc(dataLen + 1); // freed after event is fired + char* data = (char*)malloc(dataLen + 1); // Freed after event is fired memcpy(data, jsData, dataLen); data[dataLen] = '\0'; @@ -991,7 +990,7 @@ duk_ret_t CScriptInstance::js_GetROMInt(duk_context* ctx) goto return_err; } - uint8_t* rom = g_Rom->GetRomAddress(); // little endian + uint8_t* rom = g_Rom->GetRomAddress(); // Little endian uint32_t romSize = g_Rom->GetRomSize(); if (address > romSize) @@ -1060,7 +1059,7 @@ duk_ret_t CScriptInstance::js_GetROMFloat(duk_context* ctx) goto return_err; } - uint8_t* rom = g_Rom->GetRomAddress(); // little endian + uint8_t* rom = g_Rom->GetRomAddress(); // Little endian uint32_t romSize = g_Rom->GetRomSize(); if (address > romSize) @@ -1351,7 +1350,7 @@ duk_ret_t CScriptInstance::js_MsgBox(duk_context* ctx) return 1; } -// Return zero-terminated string from ram +// Return zero-terminated string from RAM duk_ret_t CScriptInstance::js_GetRDRAMString(duk_context* ctx) { CScriptInstance* _this = FetchInstance(ctx); @@ -1373,8 +1372,8 @@ duk_ret_t CScriptInstance::js_GetRDRAMString(duk_context* ctx) uint8_t test = 0xFF; int len = 0; - // determine length of string - while (len < maxLen && _this->m_Debugger->DebugLoad_VAddr(address + len, test) && test != 0) // todo protect from ram overrun + // Determine length of string + while (len < maxLen && _this->m_Debugger->DebugLoad_VAddr(address + len, test) && test != 0) // TODO: protect from RAM overrun { if ((address & 0xFFFFFF) + len >= g_MMU->RdramSize()) { @@ -1394,11 +1393,11 @@ duk_ret_t CScriptInstance::js_GetRDRAMString(duk_context* ctx) duk_pop_n(ctx, nargs); duk_push_string(ctx, (char*)str); - free(str); // duk creates internal copy + free(str); // Duk creates internal copy return 1; } -// Return zero-terminated string from rom +// Return zero-terminated string from ROM duk_ret_t CScriptInstance::js_GetROMString(duk_context* ctx) { // (address[, maxLen]) @@ -1444,11 +1443,11 @@ duk_ret_t CScriptInstance::js_GetROMString(duk_context* ctx) duk_pop(ctx); duk_push_string(ctx, str); - free(str); // duk creates internal copy + free(str); // Duk creates internal copy return 1; } -// Return zero-terminated string from rom +// Return zero-terminated string from ROM duk_ret_t CScriptInstance::js_GetROMBlock(duk_context* ctx) { uint32_t address = duk_get_uint(ctx, 0); @@ -1619,7 +1618,7 @@ duk_ret_t CScriptInstance::js_FSWrite(duk_context* ctx) if (duk_is_string(ctx, 1)) { - // string + // String const char* str = duk_get_string(ctx, 1); length = strlen(str); @@ -1627,7 +1626,7 @@ duk_ret_t CScriptInstance::js_FSWrite(duk_context* ctx) } else { - // buffer + // Buffer buffer = (const char*)duk_get_buffer_data(ctx, 1, &length); if (buffer == NULL) @@ -1930,8 +1929,6 @@ duk_ret_t CScriptInstance::js_FSReadDir(duk_context* ctx) return 1; } -//////////// - static BOOL ConnectEx(SOCKET s, const SOCKADDR* name, int namelen, PVOID lpSendBuffer, DWORD dwSendDataLength, LPDWORD lpdwBytesSent, LPOVERLAPPED lpOverlapped) { @@ -1956,4 +1953,4 @@ static BOOL ConnectEx(SOCKET s, const SOCKADDR* name, int namelen, PVOID lpSendB } return false; -} \ No newline at end of file +} From b78451cf4d897e6a145464359c49f1ae713cb704 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Wed, 17 Mar 2021 22:57:35 -0500 Subject: [PATCH 42/42] Update Debugger-MemorySearch.cpp Fix capitalization, fix some TODO comments, fix spacing, adjust some wording, remove some comments --- .../Debugger/Debugger-MemorySearch.cpp | 68 +++++++++---------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-MemorySearch.cpp b/Source/Project64/UserInterface/Debugger/Debugger-MemorySearch.cpp index 37220d005..d7baf854b 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-MemorySearch.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-MemorySearch.cpp @@ -53,7 +53,7 @@ LRESULT CDebugMemorySearch::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARA m_AddrEnd.SetDisplayType(CEditNumber32::DisplayHex); m_AddrStart.SetDisplayType(CEditNumber32::DisplayHex); - UpdateOptions(); // setup search type combobox + UpdateOptions(); // Setup search type combo box CComboBox & vtcb = m_ValueTypeOptions; vtcb.SetItemData(vtcb.AddString(L"int8"), ValueType_int8); @@ -236,8 +236,8 @@ LRESULT CDebugMemorySearch::OnSearchButton(WORD /*wNotifyCode*/, WORD /*wID*/, H { g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_SearchMemory); Search(); - // emulator won't resume sometimes unless there's a sleep() here - Sleep(50); // todo fix? + // Emulator won't resume sometimes unless there's a sleep() here + Sleep(50); // TODO: fix? g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_SearchMemory); return FALSE; } @@ -262,7 +262,7 @@ LRESULT CDebugMemorySearch::OnScanTypeChanged(WORD /*wNotifyCode*/, WORD /*wID*/ SetComboBoxSelByData(m_ValueTypeOptions, ValueType_int32); m_ValueTypeOptions.EnableWindow(FALSE); - // remember checkbox states + // Remember checkbox states m_bJalHexWasChecked = (m_HexCheckbox.GetCheck() == BST_CHECKED); m_bJalUnsignedWasChecked = (m_UnsignedCheckbox.GetCheck() == BST_CHECKED); @@ -383,7 +383,7 @@ LRESULT CDebugMemorySearch::OnResultsCustomDraw(LPNMHDR lpnmh) case ResultsListCtrl_Col_Address: if (presult->m_AddressType == AddressType_Physical) { - // green if address is physical + // Green if address is physical pLVCD->clrText = RGB(0x44, 0x88, 0x44); } break; @@ -399,13 +399,13 @@ LRESULT CDebugMemorySearch::OnResultsCustomDraw(LPNMHDR lpnmh) pLVCD->clrText = RGB(0, 0, 0); if (presult->m_DisplayFormat == DisplayHex) { - // blue if hex string + // Blue if hex string pLVCD->clrText = RGB(0, 0, 255); } } else if (strcmp(szCurrentValue, szOldValue) != 0) { - // red if value has changed + // Red if value has changed pLVCD->clrText = RGB(255, 0, 0); } } @@ -442,15 +442,15 @@ LRESULT CDebugMemorySearch::OnResultsRClick(LPNMHDR /*lpnmh*/) return true; } - //Load the menu + // Load the menu HMENU hMenu = LoadMenu(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_MEM_SEARCH)); HMENU hPopupMenu = GetSubMenu(hMenu, 0); - //Get the current Mouse location + // Get the current mouse location POINT Mouse; GetCursorPos(&Mouse); - //Show the menu + // Show the menu TrackPopupMenu(hPopupMenu, 0, Mouse.x, Mouse.y, 0, m_hWnd, NULL); DestroyMenu(hMenu); return true; @@ -597,7 +597,7 @@ LRESULT CDebugMemorySearch::OnWatchListCustomDraw(LPNMHDR lpnmh) case WatchListCtrl_Col_Address: if (presult->m_AddressType == AddressType_Physical) { - // green if address is physical + // Green if address is physical pLVCD->clrText = RGB(0x44, 0x88, 0x44); } break; @@ -607,7 +607,7 @@ LRESULT CDebugMemorySearch::OnWatchListCustomDraw(LPNMHDR lpnmh) pLVCD->clrText = RGB(0, 0, 0); if (presult->m_DisplayFormat == DisplayHex) { - // blue if hex string + // Blue if hex string pLVCD->clrText = RGB(0, 0, 255); } } @@ -633,7 +633,7 @@ LRESULT CDebugMemorySearch::OnWatchListDblClick(LPNMHDR /*lpnmh*/) int nSelectedCol = -1; - // hit test for column + // Hit test for column POINT mousePt; RECT listRect; @@ -732,11 +732,11 @@ LRESULT CDebugMemorySearch::OnWatchListRClick(LPNMHDR /*lpnmh*/) int index = m_WatchListCtrl.GetItemData(iItem); CScanResult *presult = &m_WatchList[index]; - //Load the menu + // Load the menu HMENU hMenu = LoadMenu(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_MEM_WATCHLIST)); HMENU hPopupMenu = GetSubMenu(hMenu, 0); - //Get the current Mouse location + // Get the current mouse location POINT Mouse; GetCursorPos(&Mouse); @@ -752,7 +752,7 @@ LRESULT CDebugMemorySearch::OnWatchListRClick(LPNMHDR /*lpnmh*/) CheckMenuItem(hPopupMenu, ID_WATCHLIST_WRITEBP, bHaveWriteBP ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hPopupMenu, ID_WATCHLIST_HEXADECIMAL, bHex ? MF_CHECKED : MF_UNCHECKED); - //Show the menu + // Show the menu TrackPopupMenu(hPopupMenu, 0, Mouse.x, Mouse.y, 0, m_hWnd, NULL); DestroyMenu(hMenu); return true; @@ -825,7 +825,7 @@ LRESULT CDebugMemorySearch::OnWatchListPopupAddSymbol(WORD /*wNotifyCode*/, WORD return FALSE; } - // todo fix magic numbers + // TODO: fix magic numbers int nSymType = 1; switch (presult->GetType()) @@ -897,7 +897,7 @@ LRESULT CDebugMemorySearch::OnWatchListPopupChangeValue(WORD /*wNotifyCode*/, WO int index = m_WatchListCtrl.GetItemData(iItem); CScanResult* presult = &m_WatchList[index]; stdstr enteredString = stdstr().FromUTF16(m_SetValueDlg.GetEnteredString()); - // todo prompt for size change if string is too long + // TODO: prompt for size change if string is too long presult->SetMemoryValueFromString(enteredString.c_str()); m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Value, stdstr(enteredString).ToUTF16().c_str()); } @@ -1206,7 +1206,7 @@ LRESULT CDebugMemorySearch::OnWatchListPopupCopyAddressAndDescription(WORD /*wNo LRESULT CDebugMemorySearch::OnSetFont(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/) { - // set row height for the results list and watch list + // Set row height for the results list and watch list CClientDC dc(m_hWnd); dc.SelectFont((HFONT)wParam); TEXTMETRIC tm; @@ -1306,7 +1306,7 @@ void CDebugMemorySearch::OnInterceptMouseMove(WPARAM /*wParam*/, LPARAM /*lParam CRect sepRect, windowRect; int yChange = cursorPos.y - m_LastSeparatorRect.top; - // move separator + // Move separator HWND hSeparator = GetDlgItem(IDC_SEPARATOR); ::GetWindowRect(hSeparator, &sepRect); ScreenToClient(&sepRect); @@ -1314,19 +1314,19 @@ void CDebugMemorySearch::OnInterceptMouseMove(WPARAM /*wParam*/, LPARAM /*lParam SWP_NOSIZE | SWP_NOZORDER); ::InvalidateRect(hSeparator, NULL, true); - // move and resize controls + // Move and resize controls SeparatorMoveCtrl(IDC_LST_WATCHLIST, yChange, false); SeparatorMoveCtrl(IDC_SCRL_WATCHLIST, yChange, false); SeparatorMoveCtrl(IDC_NUM_RESULTS, yChange, true); SeparatorMoveCtrl(IDC_LST_RESULTS, yChange, true); SeparatorMoveCtrl(IDC_SCRL_RESULTS, yChange, true); - // adjust window height + // Adjust window height GetWindowRect(&windowRect); windowRect.bottom += yChange; SetWindowPos(HWND_TOP, &windowRect, SWP_NOMOVE); - // save separator pos + // Save separator position ::GetWindowRect(hSeparator, &m_LastSeparatorRect); ScreenToClient(&m_LastSeparatorRect); } @@ -1338,21 +1338,21 @@ void CDebugMemorySearch::OnInterceptMouseWheel(WPARAM wParam, LPARAM /*lParam*/) if (MouseHovering(IDC_LST_RESULTS) || MouseHovering(IDC_SCRL_RESULTS)) { - // scroll results list + // Scroll results list int scrollPos = m_ResultsScrollbar.GetScrollPos(); m_ResultsScrollbar.SetScrollPos(scrollPos + nScroll); UpdateResultsList(); } else if (MouseHovering(IDC_LST_WATCHLIST) || MouseHovering(IDC_SCRL_WATCHLIST)) { - // scroll watch list + // Scroll watch list int scrollPos = m_WatchListScrollbar.GetScrollPos(); m_WatchListScrollbar.SetScrollPos(scrollPos + nScroll); UpdateWatchList(); } } -// util +// Utility void CDebugMemorySearch::ClearWatchList(void) { @@ -1466,12 +1466,12 @@ void CDebugMemorySearch::SeparatorMoveCtrl(WORD ctrlId, int yChange, bool bResiz ::GetWindowRect(hControl, &rect); ScreenToClient(&rect); - if (bResize) // resize control + if (bResize) // Resize control { ::SetWindowPos(hControl, NULL, 0, 0, rect.Width(), rect.Height() + yChange, SWP_NOMOVE | SWP_NOZORDER); } - else // move control + else // Move control { ::SetWindowPos(hControl, NULL, rect.left, rect.top + yChange, 0, 0, SWP_NOSIZE | SWP_NOZORDER); @@ -1768,7 +1768,7 @@ void CDebugMemorySearch::UpdateOptions(void) valueType == ValueType_istring || valueType == ValueType_unkstring) { - // complex search types, disable next search + // Complex search types, disable next search ::EnableWindow(GetDlgItem(IDC_BTN_SEARCH), false); m_SearchTypeOptions.EnableWindow(FALSE); } @@ -2100,7 +2100,7 @@ void CDebugMemorySearch::LoadWatchList(void) if (result.IsStringType()) { // g_MMU is null here, can't use SetStrLengthSafe - // todo fix + // TODO: fix result.SetStrLength(charArrayLength); } @@ -2167,8 +2167,6 @@ CPath CDebugMemorySearch::GetWatchListPath(void) return wlFilePath; } -//////////////////////// - INT_PTR CSetValueDlg::DoModal(const char* caption, const char* label, const char* initialText) { m_Mode = Mode_TextBox; @@ -2292,8 +2290,6 @@ CSetValueDlg::~CSetValueDlg(void) } } -//////////////////////// - CEditMixed::CEditMixed(void) : m_String(NULL) { @@ -2442,7 +2438,7 @@ bool CEditMixed::GetValue(uint64_t& value) if (*end != '\0') { - return false; // parse failure + return false; // Parse failure } value = res; @@ -2463,7 +2459,7 @@ bool CEditMixed::GetValue(int64_t& value) if (*end != '\0') { - return false; // parse failure + return false; // Parse failure } value = res;