Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove all tab/space mismatches from the DolphinWX project (at least …
…99%. I promise!)

Also fix up the dangling else's. Shit just looks incredibly ugly in terms of actual structure in the code.

I took the liberty of adding comments in FifoPlayerDlg.cpp, LogConfigWindow.cpp, LogWindow.cpp, and FrameAui.cpp to better explain some things.

If any comments are wrong, don't hesitate to complain.
  • Loading branch information
lioncash committed Apr 8, 2013
1 parent 5b2d9a7 commit 1db10b1
Show file tree
Hide file tree
Showing 36 changed files with 586 additions and 297 deletions.
4 changes: 4 additions & 0 deletions Source/Core/DolphinWX/Src/ARCodeAddEdit.cpp
Expand Up @@ -170,8 +170,12 @@ void CARCodeAddEdit::UpdateTextCtrl(ActionReplay::ARCode arCode)
EditCheatCode->Clear();

if (arCode.name != "")
{
for (u32 i = 0; i < arCode.ops.size(); i++)
EditCheatCode->AppendText(wxString::Format(wxT("%08X %08X\n"), arCode.ops.at(i).cmd_addr, arCode.ops.at(i).value));
}
else
{
EditCheatCode->SetValue(_("Insert Encrypted or Decrypted code here..."));
}
}
7 changes: 4 additions & 3 deletions Source/Core/DolphinWX/Src/CheatsWindow.cpp
Expand Up @@ -298,10 +298,11 @@ void wxCheatsWindow::OnEvent_CheatsList_ItemSelected(wxCommandEvent& WXUNUSED (e
sprintf(numcodes, "Number of Codes: %lu", (unsigned long)code.ops.size());
m_Label_NumCodes->SetLabel(StrToWxStr(numcodes));
m_ListBox_CodesList->Clear();

for (size_t j = 0; j < code.ops.size(); j++)
{
char text2[CHAR_MAX];
char* ops = text2;
char* ops = text2;
sprintf(ops, "%08x %08x", code.ops[j].cmd_addr, code.ops[j].value);
m_ListBox_CodesList->Append(StrToWxStr(ops));
}
Expand Down Expand Up @@ -332,7 +333,7 @@ void wxCheatsWindow::OnEvent_ApplyChanges_Press(wxCommandEvent& ev)
// Apply Gecko Code changes
Gecko::SetActiveCodes(m_geckocode_panel->GetCodes());

// save gameini, with changed gecko codes
// Save gameini, with changed gecko codes
if (m_gameini_path.size())
{
Gecko::SaveCodes(m_gameini, m_geckocode_panel->GetCodes());
Expand Down Expand Up @@ -409,7 +410,7 @@ void CheatSearchTab::FilterCheatSearchResults(wxCommandEvent&)
filtered_results.reserve(search_results.size());


// determine the selected filter
// Determine the selected filter
// 1 : equal
// 2 : greater-than
// 4 : less-than
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/DolphinWX/Src/ConfigMain.cpp
Expand Up @@ -1235,7 +1235,9 @@ void CConfigMain::AddRemoveISOPaths(wxCommandEvent& event)
if (dialog.ShowModal() == wxID_OK)
{
if (ISOPaths->FindString(dialog.GetPath()) != -1)
{
wxMessageBox(_("The chosen directory is already in the list"), _("Error"), wxOK);
}
else
{
bRefreshList = true;
Expand Down
4 changes: 3 additions & 1 deletion Source/Core/DolphinWX/Src/Debugger/BreakpointDlg.cpp
Expand Up @@ -47,10 +47,12 @@ void BreakPointDlg::OnOK(wxCommandEvent& event)
{
PowerPC::breakpoints.Add(Address);
Parent->NotifyUpdate();
Close();
Close();
}
else
{
PanicAlert("The address %s is invalid.", WxStrToStr(AddressString).c_str());
}

event.Skip();
}
26 changes: 13 additions & 13 deletions Source/Core/DolphinWX/Src/Debugger/BreakpointView.cpp
Expand Up @@ -40,10 +40,10 @@ void CBreakPointView::Update()
InsertColumn(0, wxT("Active"));
InsertColumn(1, wxT("Type"));
InsertColumn(2, wxT("Function"));
InsertColumn(3, wxT("Address"));
InsertColumn(4, wxT("Flags"));
InsertColumn(3, wxT("Address"));
InsertColumn(4, wxT("Flags"));

char szBuffer[64];
char szBuffer[64];
const BreakPoints::TBreakPoints& rBreakPoints = PowerPC::breakpoints.GetBreakPoints();
for (size_t i = 0; i < rBreakPoints.size(); i++)
{
Expand All @@ -63,11 +63,11 @@ void CBreakPointView::Update()
SetItem(Item, 2, temp);
}

sprintf(szBuffer, "%08x", rBP.iAddress);
temp = StrToWxStr(szBuffer);
sprintf(szBuffer, "%08x", rBP.iAddress);
temp = StrToWxStr(szBuffer);
SetItem(Item, 3, temp);

SetItemData(Item, rBP.iAddress);
SetItemData(Item, rBP.iAddress);
}
}

Expand Down Expand Up @@ -108,12 +108,12 @@ void CBreakPointView::Update()

void CBreakPointView::DeleteCurrentSelection()
{
int Item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (Item >= 0)
{
u32 Address = (u32)GetItemData(Item);
PowerPC::breakpoints.Remove(Address);
PowerPC::memchecks.Remove(Address);
int Item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (Item >= 0)
{
u32 Address = (u32)GetItemData(Item);
PowerPC::breakpoints.Remove(Address);
PowerPC::memchecks.Remove(Address);
Update();
}
}
}
92 changes: 50 additions & 42 deletions Source/Core/DolphinWX/Src/Debugger/CodeView.cpp
Expand Up @@ -62,20 +62,20 @@ END_EVENT_TABLE()
CCodeView::CCodeView(DebugInterface* debuginterface, SymbolDB *symboldb,
wxWindow* parent, wxWindowID Id)
: wxControl(parent, Id),
debugger(debuginterface),
debugger(debuginterface),
symbol_db(symboldb),
plain(false),
curAddress(debuginterface->getPC()),
align(debuginterface->getInstructionSize(0)),
rowHeight(13),
selection(0),
oldSelection(0),
selectionChanged(false),
selecting(false),
hasFocus(false),
showHex(false),
lx(-1),
ly(-1)
rowHeight(13),
selection(0),
oldSelection(0),
selectionChanged(false),
selecting(false),
hasFocus(false),
showHex(false),
lx(-1),
ly(-1)
{
}

Expand Down Expand Up @@ -104,7 +104,9 @@ void CCodeView::OnMouseDown(wxMouseEvent& event)
Refresh();
}
else
{
ToggleBreakpoint(YToAddress(y));
}

event.Skip(true);
}
Expand Down Expand Up @@ -133,7 +135,9 @@ void CCodeView::OnMouseMove(wxMouseEvent& event)
Refresh();
}
else
{
OnMouseDown(event);
}
}

event.Skip(true);
Expand Down Expand Up @@ -176,14 +180,17 @@ u32 CCodeView::AddrToBranch(u32 addr)
void CCodeView::InsertBlrNop(int Blr)
{
// Check if this address has been modified
int find = -1;
int find = -1;
for(u32 i = 0; i < BlrList.size(); i++)
{
if(BlrList.at(i).Address == selection)
{ find = i; break; }
{
find = i;
break;
}
}

// Save the old value
// Save the old value
if (find >= 0)
{
debugger->writeExtraMemory(0, BlrList.at(find).OldValue, selection);
Expand All @@ -196,11 +203,11 @@ void CCodeView::InsertBlrNop(int Blr)
Temp.OldValue = debugger->readMemory(selection);
BlrList.push_back(Temp);
if (Blr == 0)
debugger->insertBLR(selection, 0x4e800020);
debugger->insertBLR(selection, 0x4e800020);
else
debugger->insertBLR(selection, 0x60000000);
debugger->insertBLR(selection, 0x60000000);
}
Refresh();
Refresh();
}

void CCodeView::OnPopupMenu(wxCommandEvent& event)
Expand All @@ -211,14 +218,14 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)

switch (event.GetId())
{
case IDM_GOTOINMEMVIEW:
// CMemoryDlg::Goto(selection);
break;
case IDM_GOTOINMEMVIEW:
// CMemoryDlg::Goto(selection);
break;

#if wxUSE_CLIPBOARD
case IDM_COPYADDRESS:
wxTheClipboard->SetData(new wxTextDataObject(wxString::Format(_T("%08x"), selection)));
break;
case IDM_COPYADDRESS:
wxTheClipboard->SetData(new wxTextDataObject(wxString::Format(_T("%08x"), selection)));
break;

case IDM_COPYCODE:
{
Expand All @@ -228,13 +235,13 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
}
break;

case IDM_COPYHEX:
{
char temp[24];
sprintf(temp, "%08x", debugger->readInstruction(selection));
wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(temp)));
}
break;
case IDM_COPYHEX:
{
char temp[24];
sprintf(temp, "%08x", debugger->readInstruction(selection));
wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(temp)));
}
break;


case IDM_COPYFUNCTION:
Expand All @@ -259,11 +266,11 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
break;
#endif

case IDM_RUNTOHERE:
debugger->setBreakpoint(selection);
debugger->runToBreakpoint();
Refresh();
break;
case IDM_RUNTOHERE:
debugger->setBreakpoint(selection);
debugger->runToBreakpoint();
Refresh();
break;

// Insert blr or restore old value
case IDM_INSERTBLR:
Expand All @@ -275,9 +282,9 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
Refresh();
break;

case IDM_JITRESULTS:
case IDM_JITRESULTS:
debugger->showJitResults(selection);
break;
break;

case IDM_FOLLOWBRANCH:
{
Expand Down Expand Up @@ -366,7 +373,7 @@ void CCodeView::OnPaint(wxPaintEvent& event)
dc.GetTextExtent(_T("0WJyq"),&w,&h);

if (h > rowHeight)
rowHeight = h;
rowHeight = h;

dc.GetTextExtent(_T("W"),&w,&h);
int charWidth = w;
Expand Down Expand Up @@ -507,7 +514,8 @@ void CCodeView::OnPaint(wxPaintEvent& event)
strcpy(desc, debugger->getDescription(address).c_str());
}

if (!plain) {
if (!plain)
{
dc.SetTextForeground(_T("#0000FF")); // blue

//char temp[256];
Expand Down Expand Up @@ -535,19 +543,19 @@ void CCodeView::OnPaint(wxPaintEvent& event)

for (int i = 0; i < numBranches; i++)
{
int x = 17 + 49 * charWidth + (branches[i].srcAddr % 9) * 8;
_MoveTo(x-2, branches[i].src);
int x = 17 + 49 * charWidth + (branches[i].srcAddr % 9) * 8;
_MoveTo(x-2, branches[i].src);

if (branches[i].dst < rc.height + 400 && branches[i].dst > -400)
{
{
_LineTo(dc, x+2, branches[i].src);
_LineTo(dc, x+2, branches[i].dst);
_LineTo(dc, x-4, branches[i].dst);

_MoveTo(x, branches[i].dst - 4);
_LineTo(dc, x-4, branches[i].dst);
_LineTo(dc, x+1, branches[i].dst+5);
}
}
//else
//{
// This can be re-enabled when there is a scrollbar or
Expand Down

0 comments on commit 1db10b1

Please sign in to comment.