Merge remote-tracking branch 'origin/master' into Android-trash
This commit is contained in:
@@ -57,6 +57,8 @@
|
||||
<string>${OSX_MIN_VERSION}</string>
|
||||
<key>LSRequiresCarbon</key>
|
||||
<true/>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<true/>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
</dict>
|
||||
|
||||
@@ -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..."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
@@ -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());
|
||||
@@ -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
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <string> // System
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <wx/spinbutt.h>
|
||||
|
||||
#include "Common.h"
|
||||
@@ -43,14 +44,6 @@
|
||||
#include "Main.h"
|
||||
#include "VideoBackendBase.h"
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include <tr1/functional>
|
||||
using std::tr1::function;
|
||||
#else
|
||||
#include <functional>
|
||||
using std::function;
|
||||
#endif
|
||||
|
||||
#define TEXT_BOX(page, text) new wxStaticText(page, wxID_ANY, text, wxDefaultPosition, wxDefaultSize)
|
||||
|
||||
struct CPUCore
|
||||
@@ -59,12 +52,12 @@ struct CPUCore
|
||||
const char *name;
|
||||
};
|
||||
const CPUCore CPUCores[] = {
|
||||
{0, "Interpreter (VERY slow)"},
|
||||
{0, wxTRANSLATE("Interpreter (VERY slow)")},
|
||||
#ifdef _M_ARM
|
||||
{3, "Arm JIT (experimental)"},
|
||||
{3, wxTRANSLATE("Arm JIT (experimental)")},
|
||||
#else
|
||||
{1, "JIT Recompiler (recommended)"},
|
||||
{2, "JITIL experimental recompiler"},
|
||||
{1, wxTRANSLATE("JIT Recompiler (recommended)")},
|
||||
{2, wxTRANSLATE("JITIL experimental recompiler")},
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -268,7 +261,7 @@ void CConfigMain::InitializeGUILists()
|
||||
|
||||
// Emulator Engine
|
||||
for (unsigned int a = 0; a < (sizeof(CPUCores) / sizeof(CPUCore)); ++a)
|
||||
arrayStringFor_CPUEngine.Add(_(CPUCores[a].name));
|
||||
arrayStringFor_CPUEngine.Add(wxGetTranslation(CPUCores[a].name));
|
||||
|
||||
// DSP Engine
|
||||
arrayStringFor_DSPEngine.Add(_("DSP HLE emulation (fast)"));
|
||||
@@ -502,7 +495,7 @@ void CConfigMain::InitializeGUITooltips()
|
||||
{
|
||||
// General - Basic
|
||||
CPUThread->SetToolTip(_("This splits the Video and CPU threads, so they can be run on separate cores.\nCauses major speed improvements on PCs with more than one core, but can also cause occasional crashes/glitches."));
|
||||
Framelimit->SetToolTip(_("If you set Framelimit higher than game full speed (NTSC:60, PAL:50). Use Audio to throttle using the DSP (might fix audio clicks but can also cause constant noise depending on the game)."));
|
||||
Framelimit->SetToolTip(_("This limits the game speed to the specified number of frames per second (full speed is 60 for NTSC and 50 for PAL). Alternatively, use Audio to throttle using the DSP (might fix audio clicks but can also cause constant noise depending on the game)."));
|
||||
|
||||
// General - Advanced
|
||||
_NTSCJ->SetToolTip(_("Forces NTSC-J mode for using the Japanese ROM font.\nLeft unchecked, dolphin defaults to NTSC-U and automatically enables this setting when playing Japanese games."));
|
||||
@@ -515,7 +508,7 @@ void CConfigMain::InitializeGUITooltips()
|
||||
InterfaceLang->SetToolTip(_("Change the language of the user interface.\nRequires restart."));
|
||||
|
||||
// Audio tooltips
|
||||
DSPThread->SetToolTip(_("Run DSP LLE on a dedicated thread (not recommended)."));
|
||||
DSPThread->SetToolTip(_("Run DSP HLE and LLE on a dedicated thread (not recommended: might cause audio glitches with HLE and freezes with LLE)."));
|
||||
BackendSelection->SetToolTip(_("Changing this will have no effect while the emulator is running!"));
|
||||
|
||||
// Gamecube - Devices
|
||||
@@ -624,16 +617,17 @@ void CConfigMain::CreateGUIControls()
|
||||
SplitPath(filename, NULL, &name, &ext);
|
||||
|
||||
name += ext;
|
||||
if (-1 == theme_selection->FindString(name))
|
||||
theme_selection->Append(name);
|
||||
auto const wxname = StrToWxStr(name);
|
||||
if (-1 == theme_selection->FindString(wxname))
|
||||
theme_selection->Append(wxname);
|
||||
});
|
||||
|
||||
theme_selection->SetStringSelection(SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name);
|
||||
theme_selection->SetStringSelection(StrToWxStr(SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name));
|
||||
|
||||
// std::function = avoid error on msvc
|
||||
theme_selection->Bind(wxEVT_COMMAND_CHOICE_SELECTED, function<void(wxEvent&)>([theme_selection](wxEvent&)
|
||||
theme_selection->Bind(wxEVT_COMMAND_CHOICE_SELECTED, std::function<void(wxEvent&)>([theme_selection](wxEvent&)
|
||||
{
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name = theme_selection->GetStringSelection();
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name = WxStrToStr(theme_selection->GetStringSelection());
|
||||
main_frame->InitBitmaps();
|
||||
main_frame->UpdateGameList();
|
||||
}));
|
||||
@@ -657,7 +651,7 @@ void CConfigMain::CreateGUIControls()
|
||||
// Audio page
|
||||
DSPEngine = new wxRadioBox(AudioPage, ID_DSPENGINE, _("DSP Emulator Engine"),
|
||||
wxDefaultPosition, wxDefaultSize, arrayStringFor_DSPEngine, 0, wxRA_SPECIFY_ROWS);
|
||||
DSPThread = new wxCheckBox(AudioPage, ID_DSPTHREAD, _("DSP LLE on Thread"));
|
||||
DSPThread = new wxCheckBox(AudioPage, ID_DSPTHREAD, _("DSP on Dedicated Thread"));
|
||||
DumpAudio = new wxCheckBox(AudioPage, ID_DUMP_AUDIO, _("Dump Audio"),
|
||||
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
DPL2Decoder = new wxCheckBox(AudioPage, ID_DPL2DECODER, _("Dolby Pro Logic II decoder"));
|
||||
@@ -976,7 +970,9 @@ void CConfigMain::AudioSettingsChanged(wxCommandEvent& event)
|
||||
VolumeSlider->Enable(SupportsVolumeChanges(WxStrToStr(BackendSelection->GetStringSelection())));
|
||||
Latency->Enable(WxStrToStr(BackendSelection->GetStringSelection()) == BACKEND_OPENAL);
|
||||
DPL2Decoder->Enable(WxStrToStr(BackendSelection->GetStringSelection()) == BACKEND_OPENAL);
|
||||
SConfig::GetInstance().sBackend = WxStrToStr(BackendSelection->GetStringSelection());
|
||||
// Don't save the translated BACKEND_NULLSOUND string
|
||||
SConfig::GetInstance().sBackend = BackendSelection->GetSelection() ?
|
||||
WxStrToStr(BackendSelection->GetStringSelection()) : BACKEND_NULLSOUND;
|
||||
AudioCommon::UpdateSoundStream();
|
||||
break;
|
||||
|
||||
@@ -997,8 +993,8 @@ void CConfigMain::AddAudioBackends()
|
||||
for (std::vector<std::string>::const_iterator iter = backends.begin();
|
||||
iter != backends.end(); ++iter)
|
||||
{
|
||||
BackendSelection->Append(StrToWxStr(*iter));
|
||||
int num = BackendSelection->\
|
||||
BackendSelection->Append(wxGetTranslation(StrToWxStr(*iter)));
|
||||
int num = BackendSelection->
|
||||
FindString(StrToWxStr(SConfig::GetInstance().sBackend));
|
||||
BackendSelection->SetSelection(num);
|
||||
}
|
||||
@@ -1239,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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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++)
|
||||
{
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -104,7 +104,9 @@ void CCodeView::OnMouseDown(wxMouseEvent& event)
|
||||
Refresh();
|
||||
}
|
||||
else
|
||||
{
|
||||
ToggleBreakpoint(YToAddress(y));
|
||||
}
|
||||
|
||||
event.Skip(true);
|
||||
}
|
||||
@@ -133,7 +135,9 @@ void CCodeView::OnMouseMove(wxMouseEvent& event)
|
||||
Refresh();
|
||||
}
|
||||
else
|
||||
{
|
||||
OnMouseDown(event);
|
||||
}
|
||||
}
|
||||
|
||||
event.Skip(true);
|
||||
@@ -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);
|
||||
@@ -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)
|
||||
@@ -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:
|
||||
{
|
||||
@@ -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:
|
||||
@@ -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:
|
||||
@@ -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:
|
||||
{
|
||||
@@ -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;
|
||||
@@ -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];
|
||||
@@ -535,11 +543,11 @@ 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);
|
||||
@@ -547,7 +555,7 @@ void CCodeView::OnPaint(wxPaintEvent& event)
|
||||
_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
|
||||
|
||||
@@ -138,16 +138,16 @@ void CCodeWindow::OnHostMessage(wxCommandEvent& event)
|
||||
{
|
||||
switch (event.GetId())
|
||||
{
|
||||
case IDM_NOTIFYMAPLOADED:
|
||||
NotifyMapLoaded();
|
||||
case IDM_NOTIFYMAPLOADED:
|
||||
NotifyMapLoaded();
|
||||
if (m_BreakpointWindow) m_BreakpointWindow->NotifyUpdate();
|
||||
break;
|
||||
break;
|
||||
|
||||
case IDM_UPDATEDISASMDIALOG:
|
||||
Update();
|
||||
case IDM_UPDATEDISASMDIALOG:
|
||||
Update();
|
||||
if (codeview) codeview->Center(PC);
|
||||
if (m_RegisterWindow) m_RegisterWindow->NotifyUpdate();
|
||||
break;
|
||||
if (m_RegisterWindow) m_RegisterWindow->NotifyUpdate();
|
||||
break;
|
||||
|
||||
case IDM_UPDATEBREAKPOINTS:
|
||||
Update();
|
||||
@@ -161,31 +161,31 @@ void CCodeWindow::OnCodeStep(wxCommandEvent& event)
|
||||
{
|
||||
switch (event.GetId())
|
||||
{
|
||||
case IDM_STEP:
|
||||
case IDM_STEP:
|
||||
SingleStep();
|
||||
break;
|
||||
break;
|
||||
|
||||
case IDM_STEPOVER:
|
||||
case IDM_STEPOVER:
|
||||
StepOver();
|
||||
break;
|
||||
break;
|
||||
|
||||
case IDM_TOGGLE_BREAKPOINT:
|
||||
ToggleBreakpoint();
|
||||
break;
|
||||
|
||||
case IDM_SKIP:
|
||||
PC += 4;
|
||||
Update();
|
||||
break;
|
||||
case IDM_SKIP:
|
||||
PC += 4;
|
||||
Update();
|
||||
break;
|
||||
|
||||
case IDM_SETPC:
|
||||
PC = codeview->GetSelection();
|
||||
Update();
|
||||
break;
|
||||
case IDM_SETPC:
|
||||
PC = codeview->GetSelection();
|
||||
Update();
|
||||
break;
|
||||
|
||||
case IDM_GOTOPC:
|
||||
JumpToAddress(PC);
|
||||
break;
|
||||
case IDM_GOTOPC:
|
||||
JumpToAddress(PC);
|
||||
break;
|
||||
}
|
||||
|
||||
UpdateButtonStates();
|
||||
@@ -227,7 +227,7 @@ void CCodeWindow::OnCallstackListChange(wxCommandEvent& event)
|
||||
{
|
||||
int index = callstack->GetSelection();
|
||||
if (index >= 0)
|
||||
{
|
||||
{
|
||||
u32 address = (u32)(u64)(callstack->GetClientData(index));
|
||||
if (address)
|
||||
JumpToAddress(address);
|
||||
@@ -238,7 +238,7 @@ void CCodeWindow::OnCallersListChange(wxCommandEvent& event)
|
||||
{
|
||||
int index = callers->GetSelection();
|
||||
if (index >= 0)
|
||||
{
|
||||
{
|
||||
u32 address = (u32)(u64)(callers->GetClientData(index));
|
||||
if (address)
|
||||
JumpToAddress(address);
|
||||
@@ -249,7 +249,7 @@ void CCodeWindow::OnCallsListChange(wxCommandEvent& event)
|
||||
{
|
||||
int index = calls->GetSelection();
|
||||
if (index >= 0)
|
||||
{
|
||||
{
|
||||
u32 address = (u32)(u64)(calls->GetClientData(index));
|
||||
if (address)
|
||||
JumpToAddress(address);
|
||||
@@ -283,7 +283,9 @@ void CCodeWindow::StepOver()
|
||||
Update();
|
||||
}
|
||||
else
|
||||
{
|
||||
SingleStep();
|
||||
}
|
||||
|
||||
UpdateButtonStates();
|
||||
// Update all toolbars in the aui manager
|
||||
@@ -307,12 +309,13 @@ void CCodeWindow::UpdateLists()
|
||||
Symbol *symbol = g_symbolDB.GetSymbolFromAddr(addr);
|
||||
if (!symbol)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < (int)symbol->callers.size(); i++)
|
||||
{
|
||||
u32 caller_addr = symbol->callers[i].callAddress;
|
||||
Symbol *caller_symbol = g_symbolDB.GetSymbolFromAddr(caller_addr);
|
||||
if (caller_symbol)
|
||||
{
|
||||
{
|
||||
int idx = callers->Append(StrToWxStr(StringFromFormat
|
||||
("< %s (%08x)", caller_symbol->name.c_str(), caller_addr).c_str()));
|
||||
callers->SetClientData(idx, (void*)(u64)caller_addr);
|
||||
@@ -325,7 +328,7 @@ void CCodeWindow::UpdateLists()
|
||||
u32 call_addr = symbol->calls[i].function;
|
||||
Symbol *call_symbol = g_symbolDB.GetSymbolFromAddr(call_addr);
|
||||
if (call_symbol)
|
||||
{
|
||||
{
|
||||
int idx = calls->Append(StrToWxStr(StringFromFormat
|
||||
("> %s (%08x)", call_symbol->name.c_str(), call_addr).c_str()));
|
||||
calls->SetClientData(idx, (void*)(u64)call_addr);
|
||||
@@ -354,8 +357,7 @@ void CCodeWindow::UpdateCallstack()
|
||||
}
|
||||
|
||||
// Create CPU Mode menus
|
||||
void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter,
|
||||
wxMenuBar *pMenuBar)
|
||||
void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter, wxMenuBar *pMenuBar)
|
||||
{
|
||||
// CPU Mode
|
||||
wxMenu* pCoreMenu = new wxMenu;
|
||||
@@ -386,7 +388,7 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam
|
||||
_("Turn off all JIT functions, but still use the JIT core from Jit.cpp"),
|
||||
wxITEM_CHECK);
|
||||
pCoreMenu->Append(IDM_JITLSOFF, _("&JIT LoadStore off"),
|
||||
wxEmptyString, wxITEM_CHECK);
|
||||
wxEmptyString, wxITEM_CHECK);
|
||||
pCoreMenu->Append(IDM_JITLSLBZXOFF, _(" &JIT LoadStore lbzx off"),
|
||||
wxEmptyString, wxITEM_CHECK);
|
||||
pCoreMenu->Append(IDM_JITLSLXZOFF, _(" &JIT LoadStore lXz off"),
|
||||
@@ -394,17 +396,17 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam
|
||||
pCoreMenu->Append(IDM_JITLSLWZOFF, _("&JIT LoadStore lwz off"),
|
||||
wxEmptyString, wxITEM_CHECK);
|
||||
pCoreMenu->Append(IDM_JITLSFOFF, _("&JIT LoadStore Floating off"),
|
||||
wxEmptyString, wxITEM_CHECK);
|
||||
wxEmptyString, wxITEM_CHECK);
|
||||
pCoreMenu->Append(IDM_JITLSPOFF, _("&JIT LoadStore Paired off"),
|
||||
wxEmptyString, wxITEM_CHECK);
|
||||
wxEmptyString, wxITEM_CHECK);
|
||||
pCoreMenu->Append(IDM_JITFPOFF, _("&JIT FloatingPoint off"),
|
||||
wxEmptyString, wxITEM_CHECK);
|
||||
wxEmptyString, wxITEM_CHECK);
|
||||
pCoreMenu->Append(IDM_JITIOFF, _("&JIT Integer off"),
|
||||
wxEmptyString, wxITEM_CHECK);
|
||||
wxEmptyString, wxITEM_CHECK);
|
||||
pCoreMenu->Append(IDM_JITPOFF, _("&JIT Paired off"),
|
||||
wxEmptyString, wxITEM_CHECK);
|
||||
wxEmptyString, wxITEM_CHECK);
|
||||
pCoreMenu->Append(IDM_JITSROFF, _("&JIT SystemRegisters off"),
|
||||
wxEmptyString, wxITEM_CHECK);
|
||||
wxEmptyString, wxITEM_CHECK);
|
||||
|
||||
pMenuBar->Append(pCoreMenu, _("&JIT"));
|
||||
|
||||
@@ -448,46 +450,46 @@ void CCodeWindow::OnCPUMode(wxCommandEvent& event)
|
||||
{
|
||||
case IDM_INTERPRETER:
|
||||
PowerPC::SetMode(UseInterpreter() ? PowerPC::MODE_INTERPRETER : PowerPC::MODE_JIT);
|
||||
break;
|
||||
break;
|
||||
case IDM_BOOTTOPAUSE:
|
||||
bBootToPause = !bBootToPause;
|
||||
return;
|
||||
return;
|
||||
case IDM_AUTOMATICSTART:
|
||||
bAutomaticStart = !bAutomaticStart;
|
||||
return;
|
||||
return;
|
||||
case IDM_JITOFF:
|
||||
Core::g_CoreStartupParameter.bJITOff = event.IsChecked();
|
||||
break;
|
||||
break;
|
||||
case IDM_JITLSOFF:
|
||||
Core::g_CoreStartupParameter.bJITLoadStoreOff = event.IsChecked();
|
||||
break;
|
||||
break;
|
||||
case IDM_JITLSLXZOFF:
|
||||
Core::g_CoreStartupParameter.bJITLoadStorelXzOff = event.IsChecked();
|
||||
break;
|
||||
break;
|
||||
case IDM_JITLSLWZOFF:
|
||||
Core::g_CoreStartupParameter.bJITLoadStorelwzOff = event.IsChecked();
|
||||
break;
|
||||
break;
|
||||
case IDM_JITLSLBZXOFF:
|
||||
Core::g_CoreStartupParameter.bJITLoadStorelbzxOff = event.IsChecked();
|
||||
break;
|
||||
break;
|
||||
case IDM_JITLSFOFF:
|
||||
Core::g_CoreStartupParameter.bJITLoadStoreFloatingOff = event.IsChecked();
|
||||
break;
|
||||
break;
|
||||
case IDM_JITLSPOFF:
|
||||
Core::g_CoreStartupParameter.bJITLoadStorePairedOff = event.IsChecked();
|
||||
break;
|
||||
break;
|
||||
case IDM_JITFPOFF:
|
||||
Core::g_CoreStartupParameter.bJITFloatingPointOff = event.IsChecked();
|
||||
break;
|
||||
break;
|
||||
case IDM_JITIOFF:
|
||||
Core::g_CoreStartupParameter.bJITIntegerOff = event.IsChecked();
|
||||
break;
|
||||
break;
|
||||
case IDM_JITPOFF:
|
||||
Core::g_CoreStartupParameter.bJITPairedOff = event.IsChecked();
|
||||
break;
|
||||
break;
|
||||
case IDM_JITSROFF:
|
||||
Core::g_CoreStartupParameter.bJITSystemRegistersOff = event.IsChecked();
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
// Clear the JIT cache to enable these changes
|
||||
@@ -503,22 +505,22 @@ void CCodeWindow::OnJitMenu(wxCommandEvent& event)
|
||||
{
|
||||
case IDM_LOGINSTRUCTIONS:
|
||||
PPCTables::LogCompiledInstructions();
|
||||
break;
|
||||
break;
|
||||
|
||||
case IDM_CLEARCODECACHE:
|
||||
JitInterface::ClearCache();
|
||||
break;
|
||||
break;
|
||||
|
||||
case IDM_SEARCHINSTRUCTION:
|
||||
{
|
||||
wxString str;
|
||||
str = wxGetTextFromUser(_T(""), wxT("Op?"), wxEmptyString, this);
|
||||
for (u32 addr = 0x80000000; addr < 0x80100000; addr += 4)
|
||||
{
|
||||
{
|
||||
const char *name = PPCTables::GetInstructionName(Memory::ReadUnchecked_U32(addr));
|
||||
auto const wx_name = WxStrToStr(str);
|
||||
if (name && (wx_name == name))
|
||||
{
|
||||
{
|
||||
NOTICE_LOG(POWERPC, "Found %s at %08x", wx_name.c_str(), addr);
|
||||
}
|
||||
}
|
||||
@@ -575,10 +577,10 @@ void CCodeWindow::PopulateToolbar(wxAuiToolBar* toolBar)
|
||||
|
||||
toolBar->SetToolBitmapSize(wxSize(w, h));
|
||||
toolBar->AddTool(IDM_STEP, _("Step"), m_Bitmaps[Toolbar_Step]);
|
||||
toolBar->AddTool(IDM_STEPOVER, _("Step Over"), m_Bitmaps[Toolbar_StepOver]);
|
||||
toolBar->AddTool(IDM_STEPOVER, _("Step Over"), m_Bitmaps[Toolbar_StepOver]);
|
||||
toolBar->AddTool(IDM_SKIP, _("Skip"), m_Bitmaps[Toolbar_Skip]);
|
||||
toolBar->AddSeparator();
|
||||
toolBar->AddTool(IDM_GOTOPC, _("Show PC"), m_Bitmaps[Toolbar_GotoPC]);
|
||||
toolBar->AddTool(IDM_GOTOPC, _("Show PC"), m_Bitmaps[Toolbar_GotoPC]);
|
||||
toolBar->AddTool(IDM_SETPC, _("Set PC"), m_Bitmaps[Toolbar_SetPC]);
|
||||
toolBar->AddSeparator();
|
||||
toolBar->AddControl(new wxTextCtrl(toolBar, IDM_ADDRBOX, _T("")));
|
||||
|
||||
@@ -36,13 +36,13 @@ BEGIN_EVENT_TABLE(DSPDebuggerLLE, wxPanel)
|
||||
EVT_CLOSE(DSPDebuggerLLE::OnClose)
|
||||
EVT_MENU_RANGE(ID_RUNTOOL, ID_SHOWPCTOOL, DSPDebuggerLLE::OnChangeState)
|
||||
EVT_TEXT_ENTER(ID_ADDRBOX, DSPDebuggerLLE::OnAddrBoxChange)
|
||||
EVT_LISTBOX(ID_SYMBOLLIST, DSPDebuggerLLE::OnSymbolListChange)
|
||||
EVT_LISTBOX(ID_SYMBOLLIST, DSPDebuggerLLE::OnSymbolListChange)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id)
|
||||
: wxPanel(parent, id, wxDefaultPosition, wxDefaultSize,
|
||||
wxTAB_TRAVERSAL, _("DSP LLE Debugger"))
|
||||
wxTAB_TRAVERSAL, _("DSP LLE Debugger"))
|
||||
, m_CachedStepCounter(-1)
|
||||
{
|
||||
m_DebuggerFrame = this;
|
||||
@@ -184,14 +184,14 @@ void DSPDebuggerLLE::FocusOnPC()
|
||||
void DSPDebuggerLLE::UpdateState()
|
||||
{
|
||||
if (DSPCore_GetState() == DSPCORE_RUNNING)
|
||||
{
|
||||
{
|
||||
m_Toolbar->SetToolLabel(ID_RUNTOOL, wxT("Pause"));
|
||||
m_Toolbar->SetToolBitmap(ID_RUNTOOL,
|
||||
wxArtProvider::GetBitmap(wxART_TICK_MARK, wxART_OTHER, wxSize(10,10)));
|
||||
m_Toolbar->EnableTool(ID_STEPTOOL, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
else
|
||||
{
|
||||
m_Toolbar->SetToolLabel(ID_RUNTOOL, wxT("Run"));
|
||||
m_Toolbar->SetToolBitmap(ID_RUNTOOL,
|
||||
wxArtProvider::GetBitmap(wxART_GO_FORWARD, wxART_OTHER, wxSize(10,10)));
|
||||
|
||||
@@ -79,9 +79,10 @@ void GFXDebuggerPanel::SaveSettings() const
|
||||
|
||||
// TODO: make this work when we close the entire program too, currently on total close we get
|
||||
// weird values, perhaps because of some conflict with the rendering window
|
||||
|
||||
// TODO: get the screen resolution and make limits from that
|
||||
if (GetPosition().x < 1000 && GetPosition().y < 1000
|
||||
&& GetSize().GetWidth() < 1000
|
||||
&& GetSize().GetWidth() < 1000
|
||||
&& GetSize().GetHeight() < 1000)
|
||||
{
|
||||
file.Set("VideoWindow", "x", GetPosition().x);
|
||||
|
||||
@@ -59,15 +59,15 @@ BEGIN_EVENT_TABLE(CJitWindow, wxPanel)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
CJitWindow::CJitWindow(wxWindow* parent, wxWindowID id, const wxPoint& pos,
|
||||
const wxSize& size, long style, const wxString& name)
|
||||
const wxSize& size, long style, const wxString& name)
|
||||
: wxPanel(parent, id, pos, size, style, name)
|
||||
{
|
||||
wxBoxSizer* sizerBig = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer* sizerSplit = new wxBoxSizer(wxHORIZONTAL);
|
||||
sizerSplit->Add(ppc_box = new wxTextCtrl(this, IDM_PPC_BOX, _T("(ppc)"),
|
||||
wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE), 1, wxEXPAND);
|
||||
wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE), 1, wxEXPAND);
|
||||
sizerSplit->Add(x86_box = new wxTextCtrl(this, IDM_X86_BOX, _T("(x86)"),
|
||||
wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE), 1, wxEXPAND);
|
||||
wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE), 1, wxEXPAND);
|
||||
sizerBig->Add(block_list = new JitBlockList(this, IDM_BLOCKLIST,
|
||||
wxDefaultPosition, wxSize(100, 140),
|
||||
wxLC_REPORT | wxSUNKEN_BORDER | wxLC_ALIGN_LEFT | wxLC_SINGLE_SEL | wxLC_SORT_ASCENDING),
|
||||
@@ -107,21 +107,26 @@ void CJitWindow::Compare(u32 em_address)
|
||||
int block_num = jit->GetBlockCache()->GetBlockNumberFromStartAddress(em_address);
|
||||
if (block_num < 0)
|
||||
{
|
||||
for (int i = 0; i < 500; i++) {
|
||||
for (int i = 0; i < 500; i++)
|
||||
{
|
||||
block_num = jit->GetBlockCache()->GetBlockNumberFromStartAddress(em_address - 4 * i);
|
||||
if (block_num >= 0)
|
||||
break;
|
||||
}
|
||||
if (block_num >= 0) {
|
||||
|
||||
if (block_num >= 0)
|
||||
{
|
||||
JitBlock *block = jit->GetBlockCache()->GetBlock(block_num);
|
||||
if (!(block->originalAddress <= em_address &&
|
||||
block->originalSize + block->originalAddress >= em_address))
|
||||
block->originalSize + block->originalAddress >= em_address))
|
||||
block_num = -1;
|
||||
}
|
||||
|
||||
// Do not merge this "if" with the above - block_num changes inside it.
|
||||
if (block_num < 0) {
|
||||
if (block_num < 0)
|
||||
{
|
||||
ppc_box->SetValue(StrToWxStr(StringFromFormat("(non-code address: %08x)",
|
||||
em_address)));
|
||||
em_address)));
|
||||
x86_box->SetValue(StrToWxStr(StringFromFormat("(no translation)")));
|
||||
delete[] xDis;
|
||||
return;
|
||||
@@ -186,12 +191,14 @@ void CJitWindow::Compare(u32 em_address)
|
||||
sptr += sprintf(sptr, "%i estimated cycles\n", st.numCycles);
|
||||
|
||||
sptr += sprintf(sptr, "Num instr: PPC: %i x86: %i (blowup: %i%%)\n",
|
||||
size, num_x86_instructions, 100 * (num_x86_instructions / size - 1));
|
||||
size, num_x86_instructions, 100 * (num_x86_instructions / size - 1));
|
||||
sptr += sprintf(sptr, "Num bytes: PPC: %i x86: %i (blowup: %i%%)\n",
|
||||
size * 4, block->codeSize, 100 * (block->codeSize / (4 * size) - 1));
|
||||
size * 4, block->codeSize, 100 * (block->codeSize / (4 * size) - 1));
|
||||
|
||||
ppc_box->SetValue(StrToWxStr((char*)xDis));
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
ppc_box->SetValue(StrToWxStr(StringFromFormat(
|
||||
"(non-code address: %08x)", em_address)));
|
||||
x86_box->SetValue("---");
|
||||
@@ -209,9 +216,9 @@ void CJitWindow::OnHostMessage(wxCommandEvent& event)
|
||||
{
|
||||
switch (event.GetId())
|
||||
{
|
||||
case IDM_NOTIFYMAPLOADED:
|
||||
//NotifyMapLoaded();
|
||||
break;
|
||||
case IDM_NOTIFYMAPLOADED:
|
||||
//NotifyMapLoaded();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -229,7 +236,7 @@ enum {
|
||||
};
|
||||
|
||||
JitBlockList::JitBlockList(wxWindow* parent, const wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size, long style)
|
||||
const wxPoint& pos, const wxSize& size, long style)
|
||||
: wxListCtrl(parent, id, pos, size, style) // | wxLC_VIRTUAL)
|
||||
{
|
||||
Init();
|
||||
|
||||
@@ -90,7 +90,7 @@ void CMemoryView::OnMouseDownL(wxMouseEvent& event)
|
||||
}
|
||||
else
|
||||
{
|
||||
debugger->toggleMemCheck(YToAddress(y));
|
||||
debugger->toggleMemCheck(YToAddress(y));
|
||||
|
||||
Refresh();
|
||||
Host_UpdateBreakPointView();
|
||||
@@ -143,17 +143,17 @@ void CMemoryView::OnPopupMenu(wxCommandEvent& event)
|
||||
switch (event.GetId())
|
||||
{
|
||||
#if wxUSE_CLIPBOARD
|
||||
case IDM_COPYADDRESS:
|
||||
case IDM_COPYADDRESS:
|
||||
wxTheClipboard->SetData(new wxTextDataObject(wxString::Format(_T("%08x"), selection)));
|
||||
break;
|
||||
break;
|
||||
|
||||
case IDM_COPYHEX:
|
||||
{
|
||||
char temp[24];
|
||||
sprintf(temp, "%08x", debugger->readExtraMemory(memory, selection));
|
||||
wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(temp)));
|
||||
}
|
||||
break;
|
||||
case IDM_COPYHEX:
|
||||
{
|
||||
char temp[24];
|
||||
sprintf(temp, "%08x", debugger->readExtraMemory(memory, selection));
|
||||
wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(temp)));
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case IDM_TOGGLEMEMORY:
|
||||
@@ -197,7 +197,7 @@ void CMemoryView::OnMouseDownR(wxMouseEvent& event)
|
||||
viewAsSubMenu->Append(IDM_VIEWASFP, StrToWxStr("FP value"));
|
||||
viewAsSubMenu->Append(IDM_VIEWASASCII, StrToWxStr("ASCII"));
|
||||
viewAsSubMenu->Append(IDM_VIEWASHEX, StrToWxStr("Hex"));
|
||||
menu->AppendSubMenu(viewAsSubMenu, StrToWxStr("View As:"));
|
||||
menu->AppendSubMenu(viewAsSubMenu, StrToWxStr("View As:"));
|
||||
|
||||
PopupMenu(menu);
|
||||
}
|
||||
@@ -212,10 +212,10 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
|
||||
wxCoord w,h;
|
||||
dc.GetTextExtent(_T("0WJyq"),&w,&h,NULL,NULL,&hFont);
|
||||
if (h > rowHeight)
|
||||
rowHeight = h;
|
||||
rowHeight = h;
|
||||
dc.GetTextExtent(_T("0WJyq"),&w,&h,NULL,NULL,&DebuggerFont);
|
||||
if (h > rowHeight)
|
||||
rowHeight = h;
|
||||
rowHeight = h;
|
||||
|
||||
if (viewAsType==VIEWAS_HEX)
|
||||
dc.SetFont(hFont);
|
||||
@@ -359,7 +359,9 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
|
||||
curAddress += 32;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(dis, "INVALID VIEWAS TYPE");
|
||||
}
|
||||
|
||||
char desc[256] = "";
|
||||
if (viewAsType != VIEWAS_HEX)
|
||||
|
||||
@@ -341,13 +341,13 @@ void CMemoryWindow::onSearch(wxCommandEvent& event)
|
||||
newsize = rawData.size();
|
||||
|
||||
if (pad)
|
||||
{
|
||||
{
|
||||
tmpstr = new char[newsize + 2];
|
||||
memset(tmpstr, 0, newsize + 2);
|
||||
tmpstr[0] = '0';
|
||||
}
|
||||
else
|
||||
{
|
||||
else
|
||||
{
|
||||
tmpstr = new char[newsize + 1];
|
||||
memset(tmpstr, 0, newsize + 1);
|
||||
}
|
||||
@@ -368,7 +368,9 @@ void CMemoryWindow::onSearch(wxCommandEvent& event)
|
||||
i += 1;
|
||||
}
|
||||
delete[] tmpstr;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
//Looking for an ascii string
|
||||
size = rawData.size();
|
||||
Dest.resize(size+1);
|
||||
|
||||
@@ -31,8 +31,10 @@ static const char *special_reg_names[] = {
|
||||
"PC", "LR", "CTR", "CR", "FPSCR", "MSR", "SRR0", "SRR1", "Exceptions", "Int Mask", "Int Cause",
|
||||
};
|
||||
|
||||
static u32 GetSpecialRegValue(int reg) {
|
||||
switch (reg) {
|
||||
static u32 GetSpecialRegValue(int reg)
|
||||
{
|
||||
switch (reg)
|
||||
{
|
||||
case 0: return PowerPC::ppcState.pc;
|
||||
case 1: return PowerPC::ppcState.spr[SPR_LR];
|
||||
case 2: return PowerPC::ppcState.spr[SPR_CTR];
|
||||
@@ -50,8 +52,10 @@ static u32 GetSpecialRegValue(int reg) {
|
||||
|
||||
wxString CRegTable::GetValue(int row, int col)
|
||||
{
|
||||
if (row < 32) {
|
||||
switch (col) {
|
||||
if (row < 32)
|
||||
{
|
||||
switch (col)
|
||||
{
|
||||
case 0: return StrToWxStr(GetGPRName(row));
|
||||
case 1: return wxString::Format(wxT("%08x"), GPR(row));
|
||||
case 2: return StrToWxStr(GetFPRName(row));
|
||||
@@ -59,20 +63,26 @@ wxString CRegTable::GetValue(int row, int col)
|
||||
case 4: return wxString::Format(wxT("%016llx"), riPS1(row));
|
||||
default: return wxEmptyString;
|
||||
}
|
||||
} else {
|
||||
if (row - 32 < NUM_SPECIALS) {
|
||||
switch (col) {
|
||||
}
|
||||
else
|
||||
{
|
||||
if (row - 32 < NUM_SPECIALS)
|
||||
{
|
||||
switch (col)
|
||||
{
|
||||
case 0: return StrToWxStr(special_reg_names[row - 32]);
|
||||
case 1: return wxString::Format(wxT("%08x"), GetSpecialRegValue(row - 32));
|
||||
default: return wxEmptyString;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return wxEmptyString;
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
static void SetSpecialRegValue(int reg, u32 value) {
|
||||
switch (reg) {
|
||||
static void SetSpecialRegValue(int reg, u32 value)
|
||||
{
|
||||
switch (reg)
|
||||
{
|
||||
case 0: PowerPC::ppcState.pc = value; break;
|
||||
case 1: PowerPC::ppcState.spr[SPR_LR] = value; break;
|
||||
case 2: PowerPC::ppcState.spr[SPR_CTR] = value; break;
|
||||
@@ -94,15 +104,19 @@ void CRegTable::SetValue(int row, int col, const wxString& strNewVal)
|
||||
u32 newVal = 0;
|
||||
if (TryParse(WxStrToStr(strNewVal), &newVal))
|
||||
{
|
||||
if (row < 32) {
|
||||
if (row < 32)
|
||||
{
|
||||
if (col == 1)
|
||||
GPR(row) = newVal;
|
||||
else if (col == 3)
|
||||
riPS0(row) = newVal;
|
||||
else if (col == 4)
|
||||
riPS1(row) = newVal;
|
||||
} else {
|
||||
if ((row - 32 < NUM_SPECIALS) && (col == 1)) {
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((row - 32 < NUM_SPECIALS) && (col == 1))
|
||||
{
|
||||
SetSpecialRegValue(row - 32, newVal);
|
||||
}
|
||||
}
|
||||
@@ -135,7 +149,8 @@ wxGridCellAttr *CRegTable::GetAttr(int row, int col, wxGridCellAttr::wxAttrKind)
|
||||
attr->SetBackgroundColour(wxColour(wxT("#FFFFFF"))); //wxWHITE
|
||||
attr->SetFont(DebuggerFont);
|
||||
|
||||
switch (col) {
|
||||
switch (col)
|
||||
{
|
||||
case 1:
|
||||
attr->SetAlignment(wxALIGN_CENTER, wxALIGN_CENTER);
|
||||
break;
|
||||
@@ -149,11 +164,13 @@ wxGridCellAttr *CRegTable::GetAttr(int row, int col, wxGridCellAttr::wxAttrKind)
|
||||
}
|
||||
|
||||
bool red = false;
|
||||
switch (col) {
|
||||
switch (col)
|
||||
{
|
||||
case 1: red = row < 32 ? m_CachedRegHasChanged[row] : m_CachedSpecialRegHasChanged[row-32]; break;
|
||||
case 3:
|
||||
case 4: red = row < 32 ? m_CachedFRegHasChanged[row][col-3] : false; break;
|
||||
}
|
||||
|
||||
attr->SetTextColour(red ? wxColor(wxT("#FF0000")) : wxColor(wxT("#000000")));
|
||||
attr->IncRef();
|
||||
return attr;
|
||||
|
||||
@@ -28,8 +28,8 @@ END_EVENT_TABLE()
|
||||
|
||||
|
||||
CRegisterWindow::CRegisterWindow(wxWindow* parent, wxWindowID id,
|
||||
const wxPoint& position, const wxSize& size,
|
||||
long style, const wxString& name)
|
||||
const wxPoint& position, const wxSize& size,
|
||||
long style, const wxString& name)
|
||||
: wxPanel(parent, id, position, size, style, name)
|
||||
, m_GPRGridView(NULL)
|
||||
{
|
||||
|
||||
@@ -387,18 +387,23 @@ void FifoPlayerDlg::OnCheckEarlyMemoryUpdates(wxCommandEvent& event)
|
||||
|
||||
void FifoPlayerDlg::OnSaveFile(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
// Pointer to the file data that was created as a result of recording.
|
||||
FifoDataFile *file = FifoRecorder::GetInstance().GetRecordedFile();
|
||||
|
||||
if (file)
|
||||
{
|
||||
{
|
||||
// Bring up a save file dialog. The location the user chooses will be assigned to this variable.
|
||||
wxString path = wxSaveFileSelector(_("Dolphin FIFO"), wxT("dff"), wxEmptyString, this);
|
||||
|
||||
// Has a valid file path
|
||||
if (!path.empty())
|
||||
{
|
||||
// Attempt to save the file to the path the user chose
|
||||
wxBeginBusyCursor();
|
||||
bool result = file->Save(WxStrToStr(path).c_str());
|
||||
wxEndBusyCursor();
|
||||
|
||||
// Wasn't able to save the file, shit's whack, yo.
|
||||
if (!result)
|
||||
PanicAlert("Error saving file");
|
||||
}
|
||||
@@ -409,14 +414,21 @@ void FifoPlayerDlg::OnRecordStop(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
FifoRecorder& recorder = FifoRecorder::GetInstance();
|
||||
|
||||
// Recorder is still recording
|
||||
if (recorder.IsRecording())
|
||||
{
|
||||
// Then stop recording
|
||||
recorder.StopRecording();
|
||||
|
||||
// and disable the button to stop recording
|
||||
m_RecordStop->Disable();
|
||||
}
|
||||
else
|
||||
else // Recorder is actually about to start recording
|
||||
{
|
||||
// So start recording
|
||||
recorder.StartRecording(m_FramesToRecord, RecordingFinished);
|
||||
|
||||
// and change the button label accordingly.
|
||||
m_RecordStop->SetLabel(_("Stop"));
|
||||
}
|
||||
}
|
||||
@@ -839,10 +851,12 @@ void FifoPlayerDlg::UpdateAnalyzerGui()
|
||||
if ((int)m_framesList->GetCount() != num_frames)
|
||||
{
|
||||
m_framesList->Clear();
|
||||
|
||||
for (int i = 0; i < num_frames; ++i)
|
||||
{
|
||||
m_framesList->Append(wxString::Format(wxT("Frame %i"), i));
|
||||
}
|
||||
|
||||
wxCommandEvent ev = wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
|
||||
ev.SetInt(-1);
|
||||
OnFrameListSelectionChanged(ev);
|
||||
|
||||
@@ -94,8 +94,7 @@ CPanel::CPanel(
|
||||
|
||||
case WM_USER_SETCURSOR:
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor &&
|
||||
main_frame->RendererHasFocus() && Core::GetState() == Core::CORE_RUN &&
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
|
||||
main_frame->RendererHasFocus() && Core::GetState() == Core::CORE_RUN)
|
||||
SetCursor(wxCURSOR_BLANK);
|
||||
else
|
||||
SetCursor(wxNullCursor);
|
||||
@@ -399,11 +398,24 @@ CFrame::~CFrame()
|
||||
|
||||
bool CFrame::RendererIsFullscreen()
|
||||
{
|
||||
bool fullscreen = false;
|
||||
|
||||
if (Core::GetState() == Core::CORE_RUN || Core::GetState() == Core::CORE_PAUSE)
|
||||
{
|
||||
return m_RenderFrame->IsFullScreen();
|
||||
fullscreen = m_RenderFrame->IsFullScreen();
|
||||
}
|
||||
return false;
|
||||
|
||||
#if defined(__APPLE__)
|
||||
if (m_RenderFrame != NULL)
|
||||
{
|
||||
NSView *view = (NSView *) m_RenderFrame->GetHandle();
|
||||
NSWindow *window = [view window];
|
||||
|
||||
fullscreen = (([window styleMask] & NSFullScreenWindowMask) == NSFullScreenWindowMask);
|
||||
}
|
||||
#endif
|
||||
|
||||
return fullscreen;
|
||||
}
|
||||
|
||||
void CFrame::OnQuit(wxCommandEvent& WXUNUSED (event))
|
||||
@@ -456,10 +468,13 @@ void CFrame::OnClose(wxCloseEvent& event)
|
||||
event.Skip();
|
||||
|
||||
// Save GUI settings
|
||||
if (g_pCodeWindow) SaveIniPerspectives();
|
||||
// Close the log window now so that its settings are saved
|
||||
if (g_pCodeWindow)
|
||||
{
|
||||
SaveIniPerspectives();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Close the log window now so that its settings are saved
|
||||
m_LogWindow->Close();
|
||||
m_LogWindow = NULL;
|
||||
}
|
||||
@@ -482,7 +497,9 @@ void CFrame::PostEvent(wxCommandEvent& event)
|
||||
g_pCodeWindow->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
event.Skip();
|
||||
}
|
||||
}
|
||||
|
||||
void CFrame::OnMove(wxMoveEvent& event)
|
||||
@@ -694,16 +711,20 @@ void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event))
|
||||
m_GameListCtrl->Update();
|
||||
}
|
||||
else if (!m_GameListCtrl->GetISO(0))
|
||||
{
|
||||
m_GameListCtrl->BrowseForDirectory();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Game started by double click
|
||||
BootGame(std::string(""));
|
||||
}
|
||||
}
|
||||
|
||||
bool IsHotkey(wxKeyEvent &event, int Id)
|
||||
{
|
||||
return (event.GetKeyCode() != WXK_NONE &&
|
||||
event.GetKeyCode() == SConfig::GetInstance().m_LocalCoreStartupParameter.iHotkey[Id] &&
|
||||
event.GetKeyCode() == SConfig::GetInstance().m_LocalCoreStartupParameter.iHotkey[Id] &&
|
||||
event.GetModifiers() == SConfig::GetInstance().m_LocalCoreStartupParameter.iHotkeyModifier[Id]);
|
||||
}
|
||||
|
||||
@@ -841,7 +862,7 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
|
||||
DoFullscreen(!RendererIsFullscreen());
|
||||
// Send Debugger keys to CodeWindow
|
||||
else if (g_pCodeWindow && (event.GetKeyCode() >= WXK_F9 && event.GetKeyCode() <= WXK_F11))
|
||||
event.Skip();
|
||||
event.Skip();
|
||||
// Pause and Unpause
|
||||
else if (IsHotkey(event, HK_PLAY_PAUSE))
|
||||
DoPause();
|
||||
@@ -952,7 +973,9 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
event.Skip();
|
||||
}
|
||||
}
|
||||
|
||||
void CFrame::OnKeyUp(wxKeyEvent& event)
|
||||
@@ -980,7 +1003,18 @@ void CFrame::DoFullscreen(bool bF)
|
||||
{
|
||||
ToggleDisplayMode(bF);
|
||||
|
||||
#if defined(__APPLE__)
|
||||
NSView *view = (NSView *) m_RenderFrame->GetHandle();
|
||||
NSWindow *window = [view window];
|
||||
|
||||
if (bF != RendererIsFullscreen())
|
||||
{
|
||||
[window toggleFullScreen:nil];
|
||||
}
|
||||
#else
|
||||
m_RenderFrame->ShowFullScreen(bF, wxFULLSCREEN_ALL);
|
||||
#endif
|
||||
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)
|
||||
{
|
||||
if (bF)
|
||||
@@ -996,7 +1030,9 @@ void CFrame::DoFullscreen(bool bF)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_RenderFrame->Raise();
|
||||
}
|
||||
}
|
||||
|
||||
const CGameListCtrl *CFrame::GetGameListCtrl() const
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <Cocoa/Cocoa.h>
|
||||
#endif
|
||||
|
||||
#include "CDUtils.h"
|
||||
#include "Debugger/CodeWindow.h"
|
||||
#include "LogWindow.h"
|
||||
@@ -116,7 +120,7 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
// These have to be public
|
||||
// These have to be public
|
||||
CCodeWindow* g_pCodeWindow;
|
||||
NetPlaySetupDiag* g_NetPlaySetupDiag;
|
||||
wxCheatsWindow* g_CheatsWindow;
|
||||
@@ -130,7 +134,7 @@ public:
|
||||
void UpdateGameList();
|
||||
void ToggleLogWindow(bool bShow);
|
||||
void ToggleLogConfigWindow(bool bShow);
|
||||
void ToggleConsole(bool bShow);
|
||||
void ToggleConsole(bool bShow);
|
||||
void PostEvent(wxCommandEvent& event);
|
||||
void StatusBarMessage(const char * Text, ...);
|
||||
void ClearStatusBar();
|
||||
@@ -205,7 +209,7 @@ private:
|
||||
Toolbar_ConfigGFX,
|
||||
Toolbar_ConfigDSP,
|
||||
Toolbar_ConfigPAD,
|
||||
Toolbar_Wiimote,
|
||||
Toolbar_Wiimote,
|
||||
Toolbar_Help,
|
||||
EToolbar_Max
|
||||
};
|
||||
@@ -301,10 +305,10 @@ private:
|
||||
void OnLoadLastState(wxCommandEvent& event);
|
||||
void OnUndoLoadState(wxCommandEvent& event);
|
||||
void OnUndoSaveState(wxCommandEvent& event);
|
||||
|
||||
|
||||
void OnFrameSkip(wxCommandEvent& event);
|
||||
void OnFrameStep(wxCommandEvent& event);
|
||||
|
||||
|
||||
void OnConfigMain(wxCommandEvent& event); // Options
|
||||
void OnConfigGFX(wxCommandEvent& event);
|
||||
void OnConfigDSP(wxCommandEvent& event);
|
||||
@@ -328,7 +332,7 @@ private:
|
||||
void OnKeyUp(wxKeyEvent& event);
|
||||
|
||||
void OnMouse(wxMouseEvent& event); // Mouse
|
||||
|
||||
|
||||
void OnHostMessage(wxCommandEvent& event);
|
||||
|
||||
void OnMemcard(wxCommandEvent& event); // Misc
|
||||
|
||||
@@ -67,11 +67,15 @@ void CFrame::OnPaneClose(wxAuiManagerEvent& event)
|
||||
else
|
||||
{
|
||||
if (GetNotebookCount() == 1)
|
||||
{
|
||||
wxMessageBox(_("At least one pane must remain open."),
|
||||
_("Notice"), wxOK, this);
|
||||
}
|
||||
else if (nb->GetPageCount() != 0 && !nb->GetPageText(0).IsSameAs(wxT("<>")))
|
||||
{
|
||||
wxMessageBox(_("You can't close panes that have pages in them."),
|
||||
_("Notice"), wxOK, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Detach and delete the empty notebook
|
||||
@@ -92,14 +96,21 @@ void CFrame::ToggleLogWindow(bool bShow)
|
||||
|
||||
if (bShow)
|
||||
{
|
||||
if (!m_LogWindow) m_LogWindow = new CLogWindow(this, IDM_LOGWINDOW);
|
||||
// Create a new log window if it doesn't exist.
|
||||
if (!m_LogWindow)
|
||||
{
|
||||
m_LogWindow = new CLogWindow(this, IDM_LOGWINDOW);
|
||||
}
|
||||
|
||||
m_LogWindow->Enable();
|
||||
|
||||
DoAddPage(m_LogWindow,
|
||||
g_pCodeWindow ? g_pCodeWindow->iNbAffiliation[0] : 0,
|
||||
g_pCodeWindow ? bFloatWindow[0] : false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Hiding the log window, so disable it and remove it.
|
||||
m_LogWindow->Disable();
|
||||
DoRemovePage(m_LogWindow, true);
|
||||
}
|
||||
@@ -117,6 +128,7 @@ void CFrame::ToggleLogConfigWindow(bool bShow)
|
||||
{
|
||||
if (!m_LogConfigWindow)
|
||||
m_LogConfigWindow = new LogConfigWindow(this, m_LogWindow, IDM_LOGCONFIGWINDOW);
|
||||
|
||||
const int nbIndex = IDM_LOGCONFIGWINDOW - IDM_LOGWINDOW;
|
||||
DoAddPage(m_LogConfigWindow,
|
||||
g_pCodeWindow ? g_pCodeWindow->iNbAffiliation[nbIndex] : 0,
|
||||
@@ -147,7 +159,9 @@ void CFrame::ToggleConsole(bool bShow)
|
||||
Console->Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowWindow(GetConsoleWindow(), SW_SHOW);
|
||||
}
|
||||
|
||||
// Create the parent window if it doesn't exist
|
||||
wxPanel *ConsoleParent = (wxPanel*)FindWindowById(IDM_CONSOLEWINDOW);
|
||||
@@ -248,7 +262,9 @@ void CFrame::ClosePages()
|
||||
void CFrame::OnNotebookPageChanged(wxAuiNotebookEvent& event)
|
||||
{
|
||||
event.Skip();
|
||||
if (!g_pCodeWindow) return;
|
||||
|
||||
if (!g_pCodeWindow)
|
||||
return;
|
||||
|
||||
// Remove the blank page if any
|
||||
AddRemoveBlankPage();
|
||||
@@ -364,6 +380,7 @@ void CFrame::OnTab(wxAuiNotebookEvent& event)
|
||||
MenuPopup->Append(Item);
|
||||
Item->Enable(false);
|
||||
MenuPopup->Append(new wxMenuItem(MenuPopup));
|
||||
|
||||
for (int i = IDM_LOGWINDOW; i <= IDM_CODEWINDOW; i++)
|
||||
{
|
||||
wxWindow *Win = FindWindowById(i);
|
||||
@@ -379,6 +396,7 @@ void CFrame::OnTab(wxAuiNotebookEvent& event)
|
||||
// Line up our menu with the cursor
|
||||
wxPoint Pt = ::wxGetMousePosition();
|
||||
Pt = ScreenToClient(Pt);
|
||||
|
||||
// Show
|
||||
PopupMenu(MenuPopup, Pt);
|
||||
}
|
||||
@@ -425,6 +443,7 @@ void CFrame::TogglePane()
|
||||
if (m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
||||
NB = (wxAuiNotebook*)m_Mgr->GetAllPanes()[i].window;
|
||||
}
|
||||
|
||||
if (NB)
|
||||
{
|
||||
if (NB->GetPageCount() == 0)
|
||||
@@ -433,7 +452,9 @@ void CFrame::TogglePane()
|
||||
m_Mgr->Update();
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowResizePane();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,7 +473,10 @@ void CFrame::DoRemovePage(wxWindow *Win, bool bHide)
|
||||
Win->Reparent(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
Win->Destroy();
|
||||
}
|
||||
|
||||
Parent->Destroy();
|
||||
}
|
||||
else
|
||||
@@ -469,10 +493,13 @@ void CFrame::DoRemovePage(wxWindow *Win, bool bHide)
|
||||
Win->Reparent(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
Win->Destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (g_pCodeWindow)
|
||||
AddRemoveBlankPage();
|
||||
}
|
||||
@@ -480,8 +507,15 @@ void CFrame::DoRemovePage(wxWindow *Win, bool bHide)
|
||||
void CFrame::DoAddPage(wxWindow *Win, int i, bool Float)
|
||||
{
|
||||
if (!Win) return;
|
||||
if (i < 0 || i > GetNotebookCount()-1) i = 0;
|
||||
if (Win && GetNotebookFromId(i)->GetPageIndex(Win) != wxNOT_FOUND) return;
|
||||
|
||||
// Ensure accessor remains within valid bounds.
|
||||
if (i < 0 || i > GetNotebookCount()-1)
|
||||
i = 0;
|
||||
|
||||
// The page was already previously added, no need to add it again.
|
||||
if (Win && GetNotebookFromId(i)->GetPageIndex(Win) != wxNOT_FOUND)
|
||||
return;
|
||||
|
||||
if (!Float)
|
||||
GetNotebookFromId(i)->AddPage(Win, Win->GetName(), true);
|
||||
else
|
||||
@@ -520,10 +554,15 @@ void CFrame::OnDropDownSettingsToolbar(wxAuiToolBarEvent& event)
|
||||
wxRect rect = Tb->GetToolRect(event.GetId());
|
||||
wxPoint Pt = Tb->ClientToScreen(rect.GetBottomLeft());
|
||||
Pt = ScreenToClient(Pt);
|
||||
|
||||
// Show
|
||||
PopupMenu(menuPopup, Pt);
|
||||
|
||||
// Make the button un-stuck again
|
||||
if (!m_bEdit) Tb->SetToolSticky(event.GetId(), false);
|
||||
if (!m_bEdit)
|
||||
{
|
||||
Tb->SetToolSticky(event.GetId(), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -551,8 +590,13 @@ void CFrame::OnDropDownToolbarItem(wxAuiToolBarEvent& event)
|
||||
wxMenuItem* mItem = new wxMenuItem(menuPopup, IDM_PERSPECTIVES_0 + i,
|
||||
StrToWxStr(Perspectives[i].Name),
|
||||
wxT(""), wxITEM_CHECK);
|
||||
|
||||
menuPopup->Append(mItem);
|
||||
if (i == ActivePerspective) mItem->Check(true);
|
||||
|
||||
if (i == ActivePerspective)
|
||||
{
|
||||
mItem->Check(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -560,8 +604,10 @@ void CFrame::OnDropDownToolbarItem(wxAuiToolBarEvent& event)
|
||||
wxRect rect = tb->GetToolRect(event.GetId());
|
||||
wxPoint pt = tb->ClientToScreen(rect.GetBottomLeft());
|
||||
pt = ScreenToClient(pt);
|
||||
|
||||
// show
|
||||
PopupMenu(menuPopup, pt);
|
||||
|
||||
// make sure the button is "un-stuck"
|
||||
tb->SetToolSticky(event.GetId(), false);
|
||||
}
|
||||
@@ -609,12 +655,17 @@ void CFrame::OnDropDownToolbarSelect(wxCommandEvent& event)
|
||||
wxString DefaultValue = wxString::Format(_("Perspective %d"),
|
||||
Perspectives.size() + 1);
|
||||
dlg.SetValue(DefaultValue);
|
||||
bool DlgOk = false; int Return = 0;
|
||||
|
||||
int Return = 0;
|
||||
bool DlgOk = false;
|
||||
|
||||
while (!DlgOk)
|
||||
{
|
||||
Return = dlg.ShowModal();
|
||||
if (Return == wxID_CANCEL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (dlg.GetValue().Find(wxT(",")) != -1)
|
||||
{
|
||||
wxMessageBox(_("The name can not contain the character ','"),
|
||||
@@ -630,7 +681,9 @@ void CFrame::OnDropDownToolbarSelect(wxCommandEvent& event)
|
||||
dlg.SetValue(DefaultValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
DlgOk = true;
|
||||
}
|
||||
}
|
||||
|
||||
SPerspectives Tmp;
|
||||
@@ -663,9 +716,12 @@ void CFrame::ResetToolbarStyle()
|
||||
if (Pane.window->IsKindOf(CLASSINFO(wxAuiToolBar)))
|
||||
{
|
||||
Pane.Show();
|
||||
|
||||
// Show all of it
|
||||
if (Pane.rect.GetLeft() > GetClientSize().GetX() - 50)
|
||||
{
|
||||
Pane.Position(GetClientSize().GetX() - Pane.window->GetClientSize().GetX());
|
||||
}
|
||||
}
|
||||
}
|
||||
m_Mgr->Update();
|
||||
@@ -765,22 +821,31 @@ static int Limit(int i, int Low, int High)
|
||||
|
||||
void CFrame::SetPaneSize()
|
||||
{
|
||||
if (Perspectives.size() <= ActivePerspective) return;
|
||||
int iClientX = GetSize().GetX(), iClientY = GetSize().GetY();
|
||||
if (Perspectives.size() <= ActivePerspective)
|
||||
return;
|
||||
|
||||
int iClientX = GetSize().GetX();
|
||||
int iClientY = GetSize().GetY();
|
||||
|
||||
for (u32 i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
||||
{
|
||||
if (!m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiToolBar)))
|
||||
{
|
||||
if (!m_Mgr->GetAllPanes()[i].IsOk()) return;
|
||||
if (!m_Mgr->GetAllPanes()[i].IsOk())
|
||||
return;
|
||||
|
||||
if (Perspectives[ActivePerspective].Width.size() <= j ||
|
||||
Perspectives[ActivePerspective].Height.size() <= j)
|
||||
continue;
|
||||
|
||||
// Width and height of the active perspective
|
||||
u32 W = Perspectives[ActivePerspective].Width[j],
|
||||
H = Perspectives[ActivePerspective].Height[j];
|
||||
|
||||
// Check limits
|
||||
W = Limit(W, 5, 95);
|
||||
H = Limit(H, 5, 95);
|
||||
|
||||
// Convert percentages to pixel lengths
|
||||
W = (W * iClientX) / 100;
|
||||
H = (H * iClientY) / 100;
|
||||
@@ -859,8 +924,10 @@ void CFrame::LoadIniPerspectives()
|
||||
std::string _Section, _Perspective, _Width, _Height;
|
||||
std::vector<std::string> _SWidth, _SHeight;
|
||||
Tmp.Name = VPerspectives[i];
|
||||
|
||||
// Don't save a blank perspective
|
||||
if (Tmp.Name.empty()) continue;
|
||||
if (Tmp.Name.empty())
|
||||
continue;
|
||||
|
||||
_Section = StringFromFormat("P - %s", Tmp.Name.c_str());
|
||||
ini.Get(_Section.c_str(), "Perspective", &_Perspective,
|
||||
@@ -984,10 +1051,12 @@ wxWindow * CFrame::GetNotebookPageFromId(wxWindowID Id)
|
||||
{
|
||||
if (!m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
||||
continue;
|
||||
|
||||
wxAuiNotebook * NB = (wxAuiNotebook*)m_Mgr->GetAllPanes()[i].window;
|
||||
for(u32 j = 0; j < NB->GetPageCount(); j++)
|
||||
{
|
||||
if (NB->GetPage(j)->GetId() == Id) return NB->GetPage(j);
|
||||
if (NB->GetPage(j)->GetId() == Id)
|
||||
return NB->GetPage(j);
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
@@ -1036,12 +1105,14 @@ void CFrame::AddRemoveBlankPage()
|
||||
{
|
||||
if (!m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
||||
continue;
|
||||
|
||||
wxAuiNotebook * NB = (wxAuiNotebook*)m_Mgr->GetAllPanes()[i].window;
|
||||
for(u32 j = 0; j < NB->GetPageCount(); j++)
|
||||
{
|
||||
if (NB->GetPageText(j).IsSameAs(wxT("<>")) && NB->GetPageCount() > 1)
|
||||
NB->DeletePage(j);
|
||||
}
|
||||
|
||||
if (NB->GetPageCount() == 0)
|
||||
NB->AddPage(new wxPanel(this, wxID_ANY), wxT("<>"), true);
|
||||
}
|
||||
@@ -1053,6 +1124,7 @@ int CFrame::GetNotebookAffiliation(wxWindowID Id)
|
||||
{
|
||||
if (!m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
||||
continue;
|
||||
|
||||
wxAuiNotebook * NB = (wxAuiNotebook*)m_Mgr->GetAllPanes()[i].window;
|
||||
for(u32 k = 0; k < NB->GetPageCount(); k++)
|
||||
{
|
||||
|
||||
@@ -177,10 +177,12 @@ void CFrame::CreateMenu()
|
||||
loadMenu->Append(IDM_UNDOLOADSTATE, _("Undo Load State") + wxString(wxT("\tShift+F12")));
|
||||
loadMenu->AppendSeparator();
|
||||
|
||||
for (int i = 1; i <= 8; i++) {
|
||||
for (int i = 1; i <= 8; i++)
|
||||
{
|
||||
loadMenu->Append(IDM_LOADSLOT1 + i - 1, GetMenuLabel(HK_LOAD_STATE_SLOT_1 + i - 1));
|
||||
saveMenu->Append(IDM_SAVESLOT1 + i - 1, GetMenuLabel(HK_SAVE_STATE_SLOT_1 + i - 1));
|
||||
}
|
||||
|
||||
m_MenuBar->Append(emulationMenu, _("&Emulation"));
|
||||
|
||||
// Options menu
|
||||
@@ -297,7 +299,10 @@ void CFrame::CreateMenu()
|
||||
viewMenu->Append(IDM_PURGECACHE, _("Purge Cache"));
|
||||
m_MenuBar->Append(viewMenu, _("&View"));
|
||||
|
||||
if (g_pCodeWindow) g_pCodeWindow->CreateMenu(SConfig::GetInstance().m_LocalCoreStartupParameter, m_MenuBar);
|
||||
if (g_pCodeWindow)
|
||||
{
|
||||
g_pCodeWindow->CreateMenu(SConfig::GetInstance().m_LocalCoreStartupParameter, m_MenuBar);
|
||||
}
|
||||
|
||||
// Help menu
|
||||
wxMenu* helpMenu = new wxMenu;
|
||||
@@ -428,8 +433,8 @@ void CFrame::PopulateToolbar(wxAuiToolBar* ToolBar)
|
||||
{
|
||||
int w = m_Bitmaps[Toolbar_FileOpen].GetWidth(),
|
||||
h = m_Bitmaps[Toolbar_FileOpen].GetHeight();
|
||||
ToolBar->SetToolBitmapSize(wxSize(w, h));
|
||||
|
||||
ToolBar->SetToolBitmapSize(wxSize(w, h));
|
||||
|
||||
|
||||
ToolBar->AddTool(wxID_OPEN, _("Open"), m_Bitmaps[Toolbar_FileOpen], _("Open file..."));
|
||||
ToolBar->AddTool(wxID_REFRESH, _("Refresh"), m_Bitmaps[Toolbar_Refresh], _("Refresh game list"));
|
||||
@@ -509,14 +514,7 @@ void CFrame::RecreateToolbar()
|
||||
|
||||
void CFrame::InitBitmaps()
|
||||
{
|
||||
std::string theme(SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name + "/");
|
||||
std::string dir(File::GetUserPath(D_THEMES_IDX) + theme);
|
||||
|
||||
#if !defined(_WIN32)
|
||||
// If theme does not exist in user's dir load from shared directory
|
||||
if (!File::Exists(dir))
|
||||
dir = SHARED_USER_DIR THEMES_DIR "/" + theme;
|
||||
#endif
|
||||
auto const dir = StrToWxStr(File::GetThemeDir(SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name));
|
||||
|
||||
m_Bitmaps[Toolbar_FileOpen].LoadFile(dir + "open.png", wxBITMAP_TYPE_PNG);
|
||||
m_Bitmaps[Toolbar_Refresh].LoadFile(dir + "refresh.png", wxBITMAP_TYPE_PNG);
|
||||
@@ -565,12 +563,16 @@ void CFrame::BootGame(const std::string& filename)
|
||||
}
|
||||
else if (!StartUp.m_strDefaultGCM.empty()
|
||||
&& wxFileExists(wxSafeConvertMB2WX(StartUp.m_strDefaultGCM.c_str())))
|
||||
{
|
||||
bootfile = StartUp.m_strDefaultGCM;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!SConfig::GetInstance().m_LastFilename.empty()
|
||||
&& wxFileExists(wxSafeConvertMB2WX(SConfig::GetInstance().m_LastFilename.c_str())))
|
||||
{
|
||||
bootfile = SConfig::GetInstance().m_LastFilename;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_GameListCtrl->BrowseForDirectory();
|
||||
@@ -608,14 +610,16 @@ void CFrame::DoOpen(bool Boot)
|
||||
|
||||
if (currentDir != currentDir2)
|
||||
{
|
||||
PanicAlertT("Current dir changed from %s to %s after wxFileSelector!",
|
||||
PanicAlertT("Current directory changed from %s to %s after wxFileSelector!",
|
||||
currentDir.c_str(), currentDir2.c_str());
|
||||
File::SetCurrentDir(currentDir);
|
||||
}
|
||||
|
||||
// Should we boot a new game or just change the disc?
|
||||
if (Boot && !path.IsEmpty())
|
||||
{
|
||||
BootGame(WxStrToStr(path));
|
||||
}
|
||||
else
|
||||
{
|
||||
DVDInterface::ChangeDisc(WxStrToStr(path).c_str());
|
||||
@@ -673,7 +677,8 @@ void CFrame::OnRecord(wxCommandEvent& WXUNUSED (event))
|
||||
GetMenuBar()->FindItem(IDM_RECORDREADONLY)->Check(false);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if (SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_CONTROLLER || SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_TARUKONGA)
|
||||
controllers |= (1 << i);
|
||||
|
||||
@@ -733,11 +738,15 @@ void CFrame::OnPlay(wxCommandEvent& WXUNUSED (event))
|
||||
UpdateGUI();
|
||||
}
|
||||
else
|
||||
{
|
||||
DoPause();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Core is uninitialized, start the game
|
||||
BootGame(std::string(""));
|
||||
}
|
||||
}
|
||||
|
||||
void CFrame::OnRenderParentClose(wxCloseEvent& event)
|
||||
@@ -764,7 +773,7 @@ void CFrame::OnRenderParentResize(wxSizeEvent& event)
|
||||
{
|
||||
int width, height;
|
||||
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain &&
|
||||
!RendererIsFullscreen() && !m_RenderFrame->IsMaximized() && !m_RenderFrame->IsIconized())
|
||||
!RendererIsFullscreen() && !m_RenderFrame->IsMaximized() && !m_RenderFrame->IsIconized())
|
||||
{
|
||||
m_RenderFrame->GetClientSize(&width, &height);
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowWidth = width;
|
||||
@@ -805,9 +814,6 @@ void CFrame::ToggleDisplayMode(bool bFullscreen)
|
||||
#elif defined(HAVE_XRANDR) && HAVE_XRANDR
|
||||
m_XRRConfig->ToggleDisplayMode(bFullscreen);
|
||||
#elif defined __APPLE__
|
||||
NSView* view = (NSView *)m_RenderFrame->GetHandle();
|
||||
[[view window] toggleFullScreen:[view window]];
|
||||
|
||||
if(bFullscreen)
|
||||
CGDisplayHideCursor(CGMainDisplayID());
|
||||
else
|
||||
@@ -874,6 +880,13 @@ void CFrame::StartGame(const std::string& filename)
|
||||
m_RenderFrame->Show();
|
||||
}
|
||||
|
||||
#if defined(__APPLE__)
|
||||
NSView *view = (NSView *) m_RenderFrame->GetHandle();
|
||||
NSWindow *window = [view window];
|
||||
|
||||
[window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
|
||||
#endif
|
||||
|
||||
wxBeginBusyCursor();
|
||||
|
||||
DoFullscreen(SConfig::GetInstance().m_LocalCoreStartupParameter.bFullscreen);
|
||||
@@ -923,13 +936,19 @@ void CFrame::OnBootDrive(wxCommandEvent& event)
|
||||
// Refresh the file list and browse for a favorites directory
|
||||
void CFrame::OnRefresh(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
if (m_GameListCtrl) m_GameListCtrl->Update();
|
||||
if (m_GameListCtrl)
|
||||
{
|
||||
m_GameListCtrl->Update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CFrame::OnBrowse(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
if (m_GameListCtrl) m_GameListCtrl->BrowseForDirectory();
|
||||
if (m_GameListCtrl)
|
||||
{
|
||||
m_GameListCtrl->BrowseForDirectory();
|
||||
}
|
||||
}
|
||||
|
||||
// Create screenshot
|
||||
@@ -1029,10 +1048,22 @@ void CFrame::DoStop()
|
||||
m_RenderParent->SetCursor(wxNullCursor);
|
||||
DoFullscreen(false);
|
||||
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)
|
||||
{
|
||||
m_RenderFrame->Destroy();
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(__APPLE__)
|
||||
// Disable the full screen button when not in a game.
|
||||
NSView *view = (NSView *) m_RenderFrame->GetHandle();
|
||||
NSWindow *window = [view window];
|
||||
|
||||
[window setCollectionBehavior:NSWindowCollectionBehaviorDefault];
|
||||
#endif
|
||||
|
||||
// Make sure the window is not longer set to stay on top
|
||||
m_RenderFrame->SetWindowStyle(m_RenderFrame->GetWindowStyle() & ~wxSTAY_ON_TOP);
|
||||
}
|
||||
m_RenderParent = NULL;
|
||||
|
||||
// Clean framerate indications from the status bar.
|
||||
@@ -1118,7 +1149,9 @@ void CFrame::OnConfigPAD(wxCommandEvent& WXUNUSED (event))
|
||||
InputPlugin *const pad_plugin = Pad::GetPlugin();
|
||||
bool was_init = false;
|
||||
if (g_controller_interface.IsInit()) // check if game is running
|
||||
{
|
||||
was_init = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(HAVE_X11) && HAVE_X11
|
||||
@@ -1144,7 +1177,9 @@ void CFrame::OnConfigWiimote(wxCommandEvent& WXUNUSED (event))
|
||||
InputPlugin *const wiimote_plugin = Wiimote::GetPlugin();
|
||||
bool was_init = false;
|
||||
if (g_controller_interface.IsInit()) // check if game is running
|
||||
{
|
||||
was_init = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(HAVE_X11) && HAVE_X11
|
||||
@@ -1195,7 +1230,10 @@ void CFrame::OnHelp(wxCommandEvent& event)
|
||||
|
||||
void CFrame::ClearStatusBar()
|
||||
{
|
||||
if (this->GetStatusBar()->IsEnabled()) this->GetStatusBar()->SetStatusText(wxT(""),0);
|
||||
if (this->GetStatusBar()->IsEnabled())
|
||||
{
|
||||
this->GetStatusBar()->SetStatusText(wxT(""),0);
|
||||
}
|
||||
}
|
||||
|
||||
void CFrame::StatusBarMessage(const char * Text, ...)
|
||||
@@ -1207,7 +1245,10 @@ void CFrame::StatusBarMessage(const char * Text, ...)
|
||||
vsnprintf(Str, MAX_BYTES, Text, ArgPtr);
|
||||
va_end(ArgPtr);
|
||||
|
||||
if (this->GetStatusBar()->IsEnabled()) this->GetStatusBar()->SetStatusText(StrToWxStr(Str),0);
|
||||
if (this->GetStatusBar()->IsEnabled())
|
||||
{
|
||||
this->GetStatusBar()->SetStatusText(StrToWxStr(Str),0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1224,7 +1265,9 @@ void CFrame::OnNetPlay(wxCommandEvent& WXUNUSED (event))
|
||||
g_NetPlaySetupDiag = new NetPlaySetupDiag(this, m_GameListCtrl);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_NetPlaySetupDiag->Raise();
|
||||
}
|
||||
}
|
||||
|
||||
void CFrame::OnMemcard(wxCommandEvent& WXUNUSED (event))
|
||||
@@ -1609,7 +1652,11 @@ void CFrame::UpdateGUI()
|
||||
m_bGameLoading = false;
|
||||
}
|
||||
|
||||
if (m_ToolBar) m_ToolBar->Refresh();
|
||||
// Refresh toolbar
|
||||
if (m_ToolBar)
|
||||
{
|
||||
m_ToolBar->Refresh();
|
||||
}
|
||||
|
||||
// Commit changes to manager
|
||||
m_Mgr->Update();
|
||||
@@ -1676,7 +1723,11 @@ void CFrame::GameListChanged(wxCommandEvent& event)
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_GameListCtrl) m_GameListCtrl->Update();
|
||||
// Update gamelist
|
||||
if (m_GameListCtrl)
|
||||
{
|
||||
m_GameListCtrl->Update();
|
||||
}
|
||||
}
|
||||
|
||||
// Enable and disable the toolbar
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
BEGIN_EVENT_TABLE(GCMicDialog,wxDialog)
|
||||
EVT_COMMAND_RANGE(0, NUM_HOTKEYS - 1,
|
||||
wxEVT_COMMAND_BUTTON_CLICKED, GCMicDialog::OnButtonClick)
|
||||
wxEVT_COMMAND_BUTTON_CLICKED, GCMicDialog::OnButtonClick)
|
||||
EVT_TIMER(wxID_ANY, GCMicDialog::OnButtonTimer)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
@@ -86,8 +86,8 @@ void GCMicDialog::OnKeyDown(wxKeyEvent& event)
|
||||
else
|
||||
{
|
||||
SetButtonText(ClickedButton->GetId(),
|
||||
InputCommon::WXKeyToString(g_Pressed),
|
||||
InputCommon::WXKeymodToString(g_Modkey));
|
||||
InputCommon::WXKeyToString(g_Pressed),
|
||||
InputCommon::WXKeymodToString(g_Modkey));
|
||||
SaveButtonMapping(ClickedButton->GetId(), g_Pressed, g_Modkey);
|
||||
}
|
||||
EndGetButtons();
|
||||
@@ -112,7 +112,7 @@ void GCMicDialog::DoGetButtons(int _GetId)
|
||||
if(m_ButtonMappingTimer->IsRunning())
|
||||
m_ButtonMappingTimer->Stop();
|
||||
|
||||
// Save the button Id
|
||||
// Save the button Id
|
||||
GetButtonWaitingID = _GetId;
|
||||
GetButtonWaitingTimer = 0;
|
||||
|
||||
@@ -149,7 +149,8 @@ void GCMicDialog::OnButtonClick(wxCommandEvent& event)
|
||||
{
|
||||
event.Skip();
|
||||
|
||||
if (m_ButtonMappingTimer->IsRunning()) return;
|
||||
if (m_ButtonMappingTimer->IsRunning())
|
||||
return;
|
||||
|
||||
wxTheApp->Bind(wxEVT_KEY_DOWN, &GCMicDialog::OnKeyDown, this);
|
||||
|
||||
|
||||
@@ -38,6 +38,17 @@ bool cInterfaceAGL::Create(void *&window_handle)
|
||||
int _tx, _ty, _twidth, _theight;
|
||||
Host_GetRenderWindowSize(_tx, _ty, _twidth, _theight);
|
||||
|
||||
GLWin.cocoaWin = (NSView*)(((wxPanel*)window_handle)->GetHandle());
|
||||
|
||||
// Enable high-resolution display support.
|
||||
[GLWin.cocoaWin setWantsBestResolutionOpenGLSurface:YES];
|
||||
|
||||
NSWindow *window = [GLWin.cocoaWin window];
|
||||
|
||||
float scale = [window backingScaleFactor];
|
||||
_twidth *= scale;
|
||||
_theight *= scale;
|
||||
|
||||
// Control window size and picture scaling
|
||||
s_backbuffer_width = _twidth;
|
||||
s_backbuffer_height = _theight;
|
||||
@@ -58,16 +69,14 @@ bool cInterfaceAGL::Create(void *&window_handle)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
GLWin.cocoaWin = (NSView*)(((wxPanel*)window_handle)->GetHandle());;
|
||||
if (GLWin.cocoaWin == nil) {
|
||||
ERROR_LOG(VIDEO, "failed to create window");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
[[GLWin.cocoaWin window] makeFirstResponder:GLWin.cocoaWin];
|
||||
[window makeFirstResponder:GLWin.cocoaWin];
|
||||
[GLWin.cocoaCtx setView: GLWin.cocoaWin];
|
||||
[[GLWin.cocoaWin window] makeKeyAndOrderFront: nil];
|
||||
[window makeKeyAndOrderFront: nil];
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -78,6 +87,13 @@ bool cInterfaceAGL::MakeCurrent()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cInterfaceAGL::ClearCurrent()
|
||||
{
|
||||
// not tested at all
|
||||
//clearCurrentContext();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Close backend
|
||||
void cInterfaceAGL::Shutdown()
|
||||
{
|
||||
@@ -88,12 +104,19 @@ void cInterfaceAGL::Shutdown()
|
||||
|
||||
void cInterfaceAGL::Update()
|
||||
{
|
||||
if( s_backbuffer_width == [GLWin.cocoaWin frame].size.width
|
||||
&& s_backbuffer_height == [GLWin.cocoaWin frame].size.height)
|
||||
NSWindow *window = [GLWin.cocoaWin window];
|
||||
NSSize size = [GLWin.cocoaWin frame].size;
|
||||
|
||||
float scale = [window backingScaleFactor];
|
||||
size.width *= scale;
|
||||
size.height *= scale;
|
||||
|
||||
if( s_backbuffer_width == size.width
|
||||
&& s_backbuffer_height == size.height)
|
||||
return;
|
||||
|
||||
s_backbuffer_width = [GLWin.cocoaWin frame].size.width;
|
||||
s_backbuffer_height = [GLWin.cocoaWin frame].size.height;
|
||||
s_backbuffer_width = size.width;
|
||||
s_backbuffer_height = size.height;
|
||||
|
||||
[GLWin.cocoaCtx update];
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ public:
|
||||
void Swap();
|
||||
bool Create(void *&window_handle);
|
||||
bool MakeCurrent();
|
||||
bool ClearCurrent();
|
||||
void Shutdown();
|
||||
void Update();
|
||||
|
||||
|
||||
@@ -141,12 +141,17 @@ bool cInterfaceGLX::MakeCurrent()
|
||||
#endif
|
||||
return glXMakeCurrent(GLWin.dpy, GLWin.win, GLWin.ctx);
|
||||
}
|
||||
|
||||
bool cInterfaceGLX::ClearCurrent()
|
||||
{
|
||||
return glXMakeCurrent(GLWin.dpy, None, NULL);
|
||||
}
|
||||
|
||||
|
||||
// Close backend
|
||||
void cInterfaceGLX::Shutdown()
|
||||
{
|
||||
XWindow.DestroyXWindow();
|
||||
if (GLWin.ctx && !glXMakeCurrent(GLWin.dpy, None, NULL))
|
||||
NOTICE_LOG(VIDEO, "Could not release drawing context.");
|
||||
if (GLWin.ctx)
|
||||
{
|
||||
glXDestroyContext(GLWin.dpy, GLWin.ctx);
|
||||
|
||||
@@ -36,6 +36,7 @@ public:
|
||||
void UpdateFPSDisplay(const char *Text);
|
||||
bool Create(void *&window_handle);
|
||||
bool MakeCurrent();
|
||||
bool ClearCurrent();
|
||||
void Shutdown();
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -27,6 +27,7 @@ public:
|
||||
virtual void UpdateFPSDisplay(const char *Text) {}
|
||||
virtual bool Create(void *&window_handle) { return true; }
|
||||
virtual bool MakeCurrent() { return true; }
|
||||
virtual bool ClearCurrent() { return true; }
|
||||
virtual void Shutdown() {}
|
||||
|
||||
virtual void SwapInterval(int Interval) { }
|
||||
|
||||
@@ -131,6 +131,11 @@ bool cInterfaceWGL::MakeCurrent()
|
||||
return wglMakeCurrent(hDC, hRC) ? true : false;
|
||||
}
|
||||
|
||||
bool cInterfaceWGL::ClearCurrent()
|
||||
{
|
||||
return wglMakeCurrent(hDC, NULL) ? true : false;
|
||||
}
|
||||
|
||||
// Update window width, size and etc. Called from Render.cpp
|
||||
void cInterfaceWGL::Update()
|
||||
{
|
||||
@@ -171,14 +176,14 @@ void cInterfaceWGL::Shutdown()
|
||||
NOTICE_LOG(VIDEO, "Could not release drawing context.");
|
||||
|
||||
if (!wglDeleteContext(hRC))
|
||||
ERROR_LOG(VIDEO, "Release Rendering Context Failed.");
|
||||
ERROR_LOG(VIDEO, "Attempt to release rendering context failed.");
|
||||
|
||||
hRC = NULL;
|
||||
}
|
||||
|
||||
if (hDC && !ReleaseDC(EmuWindow::GetWnd(), hDC))
|
||||
{
|
||||
ERROR_LOG(VIDEO, "Release Device Context Failed.");
|
||||
ERROR_LOG(VIDEO, "Attempt to release device context failed.");
|
||||
hDC = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ public:
|
||||
void UpdateFPSDisplay(const char *Text);
|
||||
bool Create(void *&window_handle);
|
||||
bool MakeCurrent();
|
||||
bool ClearCurrent();
|
||||
void Shutdown();
|
||||
|
||||
void Update();
|
||||
|
||||
@@ -61,7 +61,7 @@ bool sorted = false;
|
||||
extern CFrame* main_frame;
|
||||
|
||||
static int CompareGameListItems(const GameListItem* iso1, const GameListItem* iso2,
|
||||
long sortData = CGameListCtrl::COLUMN_TITLE)
|
||||
long sortData = CGameListCtrl::COLUMN_TITLE)
|
||||
{
|
||||
int t = 1;
|
||||
|
||||
@@ -732,7 +732,9 @@ void CGameListCtrl::OnKeyPress(wxListEvent& event)
|
||||
continue;
|
||||
}
|
||||
else if (lastKey != event.GetKeyCode())
|
||||
{
|
||||
sLoop = 0;
|
||||
}
|
||||
|
||||
lastKey = event.GetKeyCode();
|
||||
sLoop++;
|
||||
@@ -801,7 +803,9 @@ void CGameListCtrl::OnMouseMotion(wxMouseEvent& event)
|
||||
toolTip = new wxEmuStateTip(this, StrToWxStr(temp), &toolTip);
|
||||
}
|
||||
else
|
||||
{
|
||||
toolTip = new wxEmuStateTip(this, _("Not Set"), &toolTip);
|
||||
}
|
||||
|
||||
// Get item Coords
|
||||
GetItemRect(item, Rect);
|
||||
@@ -891,8 +895,11 @@ void CGameListCtrl::OnRightClick(wxMouseEvent& event)
|
||||
else if (selected_iso->GetFileName().substr(selected_iso->GetFileName().find_last_of(".")) != ".ciso"
|
||||
&& selected_iso->GetFileName().substr(selected_iso->GetFileName().find_last_of(".")) != ".wbfs")
|
||||
popupMenu->Append(IDM_COMPRESSGCM, _("Compress ISO..."));
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
popupMenu->Append(IDM_LIST_INSTALLWAD, _("Install to Wii Menu"));
|
||||
}
|
||||
|
||||
PopupMenu(popupMenu);
|
||||
}
|
||||
@@ -911,14 +918,20 @@ void CGameListCtrl::OnRightClick(wxMouseEvent& event)
|
||||
const GameListItem * CGameListCtrl::GetSelectedISO()
|
||||
{
|
||||
if (m_ISOFiles.size() == 0)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
else if (GetSelectedItemCount() == 0)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
long item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
|
||||
if (item == wxNOT_FOUND)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Here is a little workaround for multiselections:
|
||||
@@ -1030,6 +1043,7 @@ void CGameListCtrl::OnProperties(wxCommandEvent& WXUNUSED (event))
|
||||
const GameListItem *iso = GetSelectedISO();
|
||||
if (!iso)
|
||||
return;
|
||||
|
||||
CISOProperties ISOProperties(iso->GetFileName(), this);
|
||||
if(ISOProperties.ShowModal() == wxID_OK)
|
||||
Update();
|
||||
@@ -1249,7 +1263,9 @@ void CGameListCtrl::OnCompressGCM(wxCommandEvent& WXUNUSED (event))
|
||||
|
||||
void CGameListCtrl::OnSize(wxSizeEvent& event)
|
||||
{
|
||||
if (lastpos == event.GetSize()) return;
|
||||
if (lastpos == event.GetSize())
|
||||
return;
|
||||
|
||||
lastpos = event.GetSize();
|
||||
AutomaticColumnWidth();
|
||||
|
||||
@@ -1261,7 +1277,9 @@ void CGameListCtrl::AutomaticColumnWidth()
|
||||
wxRect rc(GetClientRect());
|
||||
|
||||
if (GetColumnCount() == 1)
|
||||
{
|
||||
SetColumnWidth(0, rc.GetWidth());
|
||||
}
|
||||
else if (GetColumnCount() > 4)
|
||||
{
|
||||
int resizable = rc.GetWidth() - (
|
||||
@@ -1291,7 +1309,6 @@ void CGameListCtrl::UnselectAll()
|
||||
{
|
||||
SetItemState(i, 0, wxLIST_STATE_SELECTED);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -301,10 +301,14 @@ void CodeConfigPanel::DownloadCodes(wxCommandEvent&)
|
||||
UpdateCodeList();
|
||||
}
|
||||
else
|
||||
{
|
||||
PanicAlertT("File contained no codes.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PanicAlertT("Failed to download codes.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ enum
|
||||
IDM_LOADMAPFILE,
|
||||
IDM_SAVEMAPFILE, IDM_SAVEMAPFILEWITHCODES,
|
||||
IDM_CREATESIGNATUREFILE,
|
||||
IDM_RENAME_SYMBOLS,
|
||||
IDM_RENAME_SYMBOLS,
|
||||
IDM_USESIGNATUREFILE,
|
||||
IDM_PATCHHLEFUNCTIONS,
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
@@ -22,7 +23,7 @@
|
||||
|
||||
BEGIN_EVENT_TABLE(HotkeyConfigDialog,wxDialog)
|
||||
EVT_COMMAND_RANGE(0, NUM_HOTKEYS - 1,
|
||||
wxEVT_COMMAND_BUTTON_CLICKED, HotkeyConfigDialog::OnButtonClick)
|
||||
wxEVT_COMMAND_BUTTON_CLICKED, HotkeyConfigDialog::OnButtonClick)
|
||||
EVT_TIMER(wxID_ANY, HotkeyConfigDialog::OnButtonTimer)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
@@ -86,8 +87,8 @@ void HotkeyConfigDialog::OnKeyDown(wxKeyEvent& event)
|
||||
else
|
||||
{
|
||||
SetButtonText(ClickedButton->GetId(),
|
||||
InputCommon::WXKeyToString(g_Pressed),
|
||||
InputCommon::WXKeymodToString(g_Modkey));
|
||||
InputCommon::WXKeyToString(g_Pressed),
|
||||
InputCommon::WXKeymodToString(g_Modkey));
|
||||
SaveButtonMapping(ClickedButton->GetId(), g_Pressed, g_Modkey);
|
||||
}
|
||||
EndGetButtons();
|
||||
@@ -112,7 +113,7 @@ void HotkeyConfigDialog::DoGetButtons(int _GetId)
|
||||
if(m_ButtonMappingTimer->IsRunning())
|
||||
m_ButtonMappingTimer->Stop();
|
||||
|
||||
// Save the button Id
|
||||
// Save the button Id
|
||||
GetButtonWaitingID = _GetId;
|
||||
GetButtonWaitingTimer = 0;
|
||||
|
||||
@@ -149,7 +150,8 @@ void HotkeyConfigDialog::OnButtonClick(wxCommandEvent& event)
|
||||
{
|
||||
event.Skip();
|
||||
|
||||
if (m_ButtonMappingTimer->IsRunning()) return;
|
||||
if (m_ButtonMappingTimer->IsRunning())
|
||||
return;
|
||||
|
||||
wxTheApp->Bind(wxEVT_KEY_DOWN, &HotkeyConfigDialog::OnKeyDown, this);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "ChunkFile.h"
|
||||
#include "ConfigManager.h"
|
||||
|
||||
#define CACHE_REVISION 0x112
|
||||
static const u32 CACHE_REVISION = 0x113;
|
||||
|
||||
#define DVD_BANNER_WIDTH 96
|
||||
#define DVD_BANNER_HEIGHT 32
|
||||
@@ -71,7 +71,7 @@ GameListItem::GameListItem(const std::string& _rFileName)
|
||||
m_volume_names = pVolume->GetNames();
|
||||
|
||||
m_Country = pVolume->GetCountry();
|
||||
m_FileSize = File::GetSize(_rFileName);
|
||||
m_FileSize = pVolume->GetRawSize();
|
||||
m_VolumeSize = pVolume->GetSize();
|
||||
|
||||
m_UniqueID = pVolume->GetUniqueID();
|
||||
@@ -137,16 +137,8 @@ GameListItem::GameListItem(const std::string& _rFileName)
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string theme = SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name + "/";
|
||||
std::string dir = File::GetUserPath(D_THEMES_IDX) + theme;
|
||||
|
||||
#if !defined(_WIN32)
|
||||
// If theme does not exist in user's dir load from shared directory
|
||||
if (!File::Exists(dir))
|
||||
dir = SHARED_USER_DIR THEMES_DIR "/" + theme;
|
||||
#endif
|
||||
// default banner
|
||||
m_Image = wxImage(dir + "nobanner.png", wxBITMAP_TYPE_PNG);
|
||||
m_Image = wxImage(StrToWxStr(File::GetThemeDir(SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name)) + "nobanner.png", wxBITMAP_TYPE_PNG);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,10 +203,10 @@ std::string GameListItem::GetCompany() const
|
||||
return m_company;
|
||||
}
|
||||
|
||||
// (-1 = Japanese, 0 = English, etc)
|
||||
// (-1 = Japanese, 0 = English, etc)?
|
||||
std::string GameListItem::GetDescription(int _index) const
|
||||
{
|
||||
const u32 index = _index + 1;
|
||||
const u32 index = _index;
|
||||
|
||||
if (index < m_descriptions.size())
|
||||
return m_descriptions[index];
|
||||
@@ -225,10 +217,10 @@ std::string GameListItem::GetDescription(int _index) const
|
||||
return "";
|
||||
}
|
||||
|
||||
// (-1 = Japanese, 0 = English, etc)
|
||||
// (-1 = Japanese, 0 = English, etc)?
|
||||
std::string GameListItem::GetVolumeName(int _index) const
|
||||
{
|
||||
u32 const index = _index + 1;
|
||||
u32 const index = _index;
|
||||
|
||||
if (index < m_volume_names.size() && !m_volume_names[index].empty())
|
||||
return m_volume_names[index];
|
||||
@@ -239,10 +231,10 @@ std::string GameListItem::GetVolumeName(int _index) const
|
||||
return "";
|
||||
}
|
||||
|
||||
// (-1 = Japanese, 0 = English, etc)
|
||||
// (-1 = Japanese, 0 = English, etc)?
|
||||
std::string GameListItem::GetBannerName(int _index) const
|
||||
{
|
||||
u32 const index = _index + 1;
|
||||
u32 const index = _index;
|
||||
|
||||
if (index < m_names.size() && !m_names[index].empty())
|
||||
return m_names[index];
|
||||
@@ -253,7 +245,7 @@ std::string GameListItem::GetBannerName(int _index) const
|
||||
return "";
|
||||
}
|
||||
|
||||
// (-1 = Japanese, 0 = English, etc)
|
||||
// (-1 = Japanese, 0 = English, etc)?
|
||||
std::string GameListItem::GetName(int _index) const
|
||||
{
|
||||
// Prefer name from banner, fallback to name from volume, fallback to filename
|
||||
|
||||
@@ -98,7 +98,9 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -131,9 +133,13 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
|
||||
_iniFilename = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
GameIniFile = File::GetUserPath(D_GAMECONFIG_IDX) + _iniFilename + ".ini";
|
||||
|
||||
if (GameIni.Load(GameIniFile.c_str()))
|
||||
{
|
||||
LoadGameConfig();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Will fail out if GameConfig folder doesn't exist
|
||||
@@ -148,6 +154,7 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
|
||||
<< "[ActionReplay] Add action replay cheats here.\n";
|
||||
f.close();
|
||||
}
|
||||
|
||||
if (GameIni.Load(GameIniFile.c_str()))
|
||||
LoadGameConfig();
|
||||
else
|
||||
@@ -226,7 +233,9 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
|
||||
}
|
||||
}
|
||||
else if (!GCFiles.empty())
|
||||
{
|
||||
CreateDirectoryTree(RootId, GCFiles, 1, GCFiles.at(0)->m_FileSize);
|
||||
}
|
||||
|
||||
m_Treectrl->Expand(RootId);
|
||||
}
|
||||
@@ -255,7 +264,11 @@ size_t CISOProperties::CreateDirectoryTree(wxTreeItemId& parent,
|
||||
const DiscIO::SFileInfo *rFileInfo = fileInfos[CurrentIndex];
|
||||
char *name = (char*)rFileInfo->m_FullPath;
|
||||
|
||||
if (rFileInfo->IsDirectory()) name[strlen(name) - 1] = '\0';
|
||||
if (rFileInfo->IsDirectory())
|
||||
{
|
||||
name[strlen(name) - 1] = '\0';
|
||||
}
|
||||
|
||||
char *itemName = strrchr(name, DIR_SEP_CHR);
|
||||
|
||||
if(!itemName)
|
||||
@@ -316,8 +329,8 @@ void CISOProperties::CreateGUIControls(bool IsWad)
|
||||
DCBZOFF->SetToolTip(_("Bypass the clearing of the data cache by the DCBZ instruction. Usually leave this option disabled."));
|
||||
VBeam = new wxCheckBox(m_GameConfig, ID_VBEAM, _("Accurate VBeam emulation"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
|
||||
VBeam->SetToolTip(_("If the FPS is erratic, this option may help. (ON = Compatible, OFF = Fast)"));
|
||||
SyncGPU = new wxCheckBox(m_GameConfig, ID_SYNCGPU, _("Synchronise GPU thread"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
|
||||
SyncGPU->SetToolTip(_("Synchonises the GPU and CPU threads to help prevent random freezes in Dual Core mode. (ON = Compatible, OFF = Fast)"));
|
||||
SyncGPU = new wxCheckBox(m_GameConfig, ID_SYNCGPU, _("Synchronize GPU thread"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
|
||||
SyncGPU->SetToolTip(_("Synchronizes the GPU and CPU threads to help prevent random freezes in Dual Core mode. (ON = Compatible, OFF = Fast)"));
|
||||
FastDiscSpeed = new wxCheckBox(m_GameConfig, ID_DISCSPEED, _("Speed up Disc Transfer Rate"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
|
||||
FastDiscSpeed->SetToolTip(_("Enable fast disc access. Needed for a few games. (ON = Fast, OFF = Compatible)"));
|
||||
BlockMerging = new wxCheckBox(m_GameConfig, ID_MERGEBLOCKS, _("Enable Block Merging"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
|
||||
@@ -664,7 +677,9 @@ void CISOProperties::OnExtractFile(wxCommandEvent& WXUNUSED (event))
|
||||
WiiDisc.at(partitionNum).FileSystem->ExportFile(WxStrToStr(File).c_str(), WxStrToStr(Path).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
pFileSystem->ExportFile(WxStrToStr(File).c_str(), WxStrToStr(Path).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void CISOProperties::ExportDir(const char* _rFullPath, const char* _rExportFolder, const int partitionNum)
|
||||
@@ -679,7 +694,9 @@ void CISOProperties::ExportDir(const char* _rFullPath, const char* _rExportFolde
|
||||
FS = WiiDisc.at(partitionNum).FileSystem;
|
||||
}
|
||||
else
|
||||
{
|
||||
FS = pFileSystem;
|
||||
}
|
||||
|
||||
FS->GetFileList(fst);
|
||||
|
||||
@@ -698,13 +715,13 @@ void CISOProperties::ExportDir(const char* _rFullPath, const char* _rExportFolde
|
||||
{
|
||||
if (!strcmp(fst.at(index[0])->m_FullPath, _rFullPath))
|
||||
{
|
||||
DEBUG_LOG(DISCIO, "Found the Dir at %u", index[0]);
|
||||
DEBUG_LOG(DISCIO, "Found the directory at %u", index[0]);
|
||||
index[1] = (u32)fst.at(index[0])->m_FileSize;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_LOG(DISCIO,"Dir found from %u to %u\nextracting to:\n%s",index[0],index[1],_rExportFolder);
|
||||
DEBUG_LOG(DISCIO,"Directory found from %u to %u\nextracting to:\n%s",index[0],index[1],_rExportFolder);
|
||||
}
|
||||
|
||||
wxString dialogTitle = index[0] ? _("Extracting Directory") : _("Extracting All Files");
|
||||
@@ -744,7 +761,7 @@ void CISOProperties::ExportDir(const char* _rFullPath, const char* _rExportFolde
|
||||
if (!File::IsDirectory(exportName))
|
||||
ERROR_LOG(DISCIO, "%s already exists and is not a directory", exportName);
|
||||
|
||||
DEBUG_LOG(DISCIO, "folder %s already exists", exportName);
|
||||
DEBUG_LOG(DISCIO, "Folder %s already exists", exportName);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -799,7 +816,9 @@ void CISOProperties::OnExtractDir(wxCommandEvent& event)
|
||||
ExportDir(WxStrToStr(Directory).c_str(), WxStrToStr(Path).c_str(), partitionNum);
|
||||
}
|
||||
else
|
||||
{
|
||||
ExportDir(WxStrToStr(Directory).c_str(), WxStrToStr(Path).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void CISOProperties::OnExtractDataFromHeader(wxCommandEvent& event)
|
||||
|
||||
@@ -34,7 +34,7 @@ void GamepadPage::ConfigExtension(wxCommandEvent& event)
|
||||
if (ex->switch_extension)
|
||||
{
|
||||
wxDialog dlg(this, -1,
|
||||
StrToWxStr(ex->attachments[ex->switch_extension]->GetName()),
|
||||
wxGetTranslation(StrToWxStr(ex->attachments[ex->switch_extension]->GetName())),
|
||||
wxDefaultPosition, wxDefaultSize);
|
||||
|
||||
wxBoxSizer* const main_szr = new wxBoxSizer(wxVERTICAL);
|
||||
@@ -64,7 +64,7 @@ PadSettingExtension::PadSettingExtension(wxWindow* const parent, ControllerEmu::
|
||||
e = extension->attachments.end();
|
||||
|
||||
for (; i!=e; ++i)
|
||||
((wxChoice*)wxcontrol)->Append(StrToWxStr((*i)->GetName()));
|
||||
((wxChoice*)wxcontrol)->Append(wxGetTranslation(StrToWxStr((*i)->GetName())));
|
||||
|
||||
UpdateGUI();
|
||||
}
|
||||
@@ -80,7 +80,7 @@ void PadSettingExtension::UpdateValue()
|
||||
}
|
||||
|
||||
PadSettingCheckBox::PadSettingCheckBox(wxWindow* const parent, ControlState& _value, const char* const label)
|
||||
: PadSetting(new wxCheckBox(parent, -1, StrToWxStr(label), wxDefaultPosition))
|
||||
: PadSetting(new wxCheckBox(parent, -1, wxGetTranslation(StrToWxStr(label)), wxDefaultPosition))
|
||||
, value(_value)
|
||||
{
|
||||
UpdateGUI();
|
||||
@@ -600,7 +600,9 @@ void GamepadPage::SaveProfile(wxCommandEvent&)
|
||||
m_config_dialog->UpdateProfileComboBox();
|
||||
}
|
||||
else
|
||||
{
|
||||
PanicAlertT("You must enter a valid profile name.");
|
||||
}
|
||||
}
|
||||
|
||||
void GamepadPage::DeleteProfile(wxCommandEvent&)
|
||||
@@ -677,7 +679,7 @@ ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWin
|
||||
for (; ci != ce; ++ci)
|
||||
{
|
||||
|
||||
wxStaticText* const label = new wxStaticText(parent, -1, StrToWxStr((*ci)->name));
|
||||
wxStaticText* const label = new wxStaticText(parent, -1, wxGetTranslation(StrToWxStr((*ci)->name)));
|
||||
|
||||
ControlButton* const control_button = new ControlButton(parent, (*ci)->control_ref, 80);
|
||||
control_button->SetFont(m_SmallFont);
|
||||
@@ -731,7 +733,7 @@ ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWin
|
||||
PadSettingSpin* setting = new PadSettingSpin(parent, *i);
|
||||
setting->wxcontrol->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &GamepadPage::AdjustSetting, eventsink);
|
||||
options.push_back(setting);
|
||||
szr->Add(new wxStaticText(parent, -1, StrToWxStr((*i)->name)));
|
||||
szr->Add(new wxStaticText(parent, -1, wxGetTranslation(StrToWxStr((*i)->name))));
|
||||
szr->Add(setting->wxcontrol, 0, wxLEFT, 0);
|
||||
}
|
||||
|
||||
@@ -757,7 +759,7 @@ ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWin
|
||||
options.push_back(threshold_cbox);
|
||||
|
||||
wxBoxSizer* const szr = new wxBoxSizer(wxHORIZONTAL);
|
||||
szr->Add(new wxStaticText(parent, -1, StrToWxStr(group->settings[0]->name)),
|
||||
szr->Add(new wxStaticText(parent, -1, wxGetTranslation(StrToWxStr(group->settings[0]->name))),
|
||||
0, wxCENTER|wxRIGHT, 3);
|
||||
szr->Add(threshold_cbox->wxcontrol, 0, wxRIGHT, 3);
|
||||
|
||||
@@ -792,7 +794,7 @@ ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWin
|
||||
setting->wxcontrol->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &GamepadPage::AdjustSetting, eventsink);
|
||||
options.push_back(setting);
|
||||
wxBoxSizer* const szr = new wxBoxSizer(wxHORIZONTAL);
|
||||
szr->Add(new wxStaticText(parent, -1, StrToWxStr((*i)->name)), 0, wxCENTER|wxRIGHT, 3);
|
||||
szr->Add(new wxStaticText(parent, -1, wxGetTranslation(StrToWxStr((*i)->name))), 0, wxCENTER|wxRIGHT, 3);
|
||||
szr->Add(setting->wxcontrol, 0, wxRIGHT, 3);
|
||||
Add(szr, 0, wxALL|wxCENTER, 3);
|
||||
}
|
||||
@@ -856,7 +858,7 @@ ControlGroupsSizer::ControlGroupsSizer(ControllerEmu* const controller, wxWindow
|
||||
{
|
||||
ControlGroupBox* control_group_box = new ControlGroupBox(controller->groups[i], parent, eventsink);
|
||||
wxStaticBoxSizer *control_group =
|
||||
new wxStaticBoxSizer(wxVERTICAL, parent, StrToWxStr(controller->groups[i]->name));
|
||||
new wxStaticBoxSizer(wxVERTICAL, parent, wxGetTranslation(StrToWxStr(controller->groups[i]->name)));
|
||||
control_group->Add(control_group_box);
|
||||
|
||||
const size_t grp_size = controller->groups[i]->controls.size() + controller->groups[i]->settings.size();
|
||||
@@ -872,7 +874,9 @@ ControlGroupsSizer::ControlGroupsSizer(ControllerEmu* const controller, wxWindow
|
||||
col_size = grp_size;
|
||||
}
|
||||
else
|
||||
{
|
||||
stacked_groups->Add(control_group, 0, wxEXPAND);
|
||||
}
|
||||
|
||||
if (groups)
|
||||
groups->push_back(control_group_box);
|
||||
@@ -952,7 +956,7 @@ GamepadPage::GamepadPage(wxWindow* parent, InputPlugin& plugin, const unsigned i
|
||||
|
||||
|
||||
InputConfigDialog::InputConfigDialog(wxWindow* const parent, InputPlugin& plugin, const std::string& name, const int tab_num)
|
||||
: wxDialog(parent, wxID_ANY, StrToWxStr(name), wxPoint(128,-1), wxDefaultSize)
|
||||
: wxDialog(parent, wxID_ANY, wxGetTranslation(StrToWxStr(name)), wxPoint(128,-1), wxDefaultSize)
|
||||
, m_plugin(plugin)
|
||||
{
|
||||
m_pad_notebook = new wxNotebook(this, -1, wxDefaultPosition, wxDefaultSize, wxNB_DEFAULT);
|
||||
@@ -960,7 +964,7 @@ InputConfigDialog::InputConfigDialog(wxWindow* const parent, InputPlugin& plugin
|
||||
{
|
||||
GamepadPage* gp = new GamepadPage(m_pad_notebook, m_plugin, i, this);
|
||||
m_padpages.push_back(gp);
|
||||
m_pad_notebook->AddPage(gp, wxString::Format(wxT("%s %u"), StrToWxStr(m_plugin.gui_name), 1+i));
|
||||
m_pad_notebook->AddPage(gp, wxString::Format(wxT("%s %u"), wxGetTranslation(StrToWxStr(m_plugin.gui_name)), 1+i));
|
||||
}
|
||||
|
||||
m_pad_notebook->SetSelection(tab_num);
|
||||
|
||||
@@ -111,7 +111,9 @@ void InputConfigDialog::UpdateBitmaps(wxTimerEvent& WXUNUSED(event))
|
||||
dc.DrawCircle( 32, 32, 32);
|
||||
}
|
||||
else
|
||||
{
|
||||
dc.DrawRectangle( 16, 16, 32, 32 );
|
||||
}
|
||||
|
||||
if ( GROUP_TYPE_CURSOR != (*g)->control_group->type )
|
||||
{
|
||||
@@ -217,7 +219,9 @@ void InputConfigDialog::UpdateBitmaps(wxTimerEvent& WXUNUSED(event))
|
||||
for (unsigned int n = 0; n<button_count; ++n)
|
||||
{
|
||||
if ( buttons & bitmasks[n] )
|
||||
{
|
||||
dc.SetBrush( *wxRED_BRUSH );
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char amt = 255 - (*g)->control_group->controls[n]->control_ref->State() * 128;
|
||||
|
||||
@@ -111,12 +111,20 @@ void LogConfigWindow::LoadSettings()
|
||||
IniFile ini;
|
||||
ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));
|
||||
|
||||
// Retrieve the verbosity value from the config ini file.
|
||||
int verbosity;
|
||||
ini.Get("Options", "Verbosity", &verbosity, 0);
|
||||
if (verbosity < 1) verbosity = 1;
|
||||
if (verbosity > MAX_LOGLEVEL) verbosity = MAX_LOGLEVEL;
|
||||
|
||||
// Ensure the verbosity level is valid.
|
||||
if (verbosity < 1)
|
||||
verbosity = 1;
|
||||
if (verbosity > MAX_LOGLEVEL)
|
||||
verbosity = MAX_LOGLEVEL;
|
||||
|
||||
// Actually set the logging verbosity.
|
||||
m_verbosity->SetSelection(verbosity - 1);
|
||||
|
||||
// Get the logger output settings from the config ini file.
|
||||
ini.Get("Options", "WriteToFile", &m_writeFile, false);
|
||||
m_writeFileCB->SetValue(m_writeFile);
|
||||
ini.Get("Options", "WriteToConsole", &m_writeConsole, true);
|
||||
@@ -134,11 +142,17 @@ void LogConfigWindow::LoadSettings()
|
||||
{
|
||||
m_writeDebugger = false;
|
||||
}
|
||||
|
||||
// Run through all of the log types and check each checkbox for each logging type
|
||||
// depending on its set value within the config ini.
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
|
||||
{
|
||||
bool log_enabled;
|
||||
ini.Get("Logs", m_LogManager->GetShortName((LogTypes::LOG_TYPE)i), &log_enabled, true);
|
||||
if (log_enabled) enableAll = false;
|
||||
|
||||
if (log_enabled)
|
||||
enableAll = false;
|
||||
|
||||
m_checks->Check(i, log_enabled);
|
||||
}
|
||||
}
|
||||
@@ -148,7 +162,10 @@ void LogConfigWindow::SaveSettings()
|
||||
IniFile ini;
|
||||
ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));
|
||||
|
||||
// Save the verbosity level.
|
||||
ini.Set("Options", "Verbosity", m_verbosity->GetSelection() + 1);
|
||||
|
||||
// Save the enabled/disabled states of the logger outputs to the config ini.
|
||||
ini.Set("Options", "WriteToFile", m_writeFile);
|
||||
ini.Set("Options", "WriteToConsole", m_writeConsole);
|
||||
ini.Set("Options", "WriteToWindow", m_writeWindow);
|
||||
@@ -156,16 +173,28 @@ void LogConfigWindow::SaveSettings()
|
||||
if (IsDebuggerPresent())
|
||||
ini.Set("Options", "WriteToDebugger", m_writeDebugger);
|
||||
#endif
|
||||
|
||||
// Save all enabled/disabled states of the log types to the config ini.
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
|
||||
{
|
||||
ini.Set("Logs", m_LogManager->GetShortName((LogTypes::LOG_TYPE)i), m_checks->IsChecked(i));
|
||||
}
|
||||
|
||||
ini.Save(File::GetUserPath(F_LOGGERCONFIG_IDX));
|
||||
}
|
||||
|
||||
// If the verbosity changes while logging
|
||||
void LogConfigWindow::OnVerbosityChange(wxCommandEvent& event)
|
||||
{
|
||||
// Get the new verbosity
|
||||
int v = m_verbosity->GetSelection() + 1;
|
||||
|
||||
// Set all log types to that verbosity level
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++)
|
||||
{
|
||||
m_LogManager->SetLogLevel((LogTypes::LOG_TYPE)i, (LogTypes::LOG_LEVELS)v);
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ BEGIN_EVENT_TABLE(CLogWindow, wxPanel)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
CLogWindow::CLogWindow(CFrame *parent, wxWindowID id, const wxPoint& pos,
|
||||
const wxSize& size, long style, const wxString& name)
|
||||
const wxSize& size, long style, const wxString& name)
|
||||
: wxPanel(parent, id, pos, size, style, name)
|
||||
, x(0), y(0), winpos(0)
|
||||
, Parent(parent), m_ignoreLogTimer(false), m_LogAccess(true)
|
||||
@@ -64,9 +64,14 @@ void CLogWindow::CreateGUIControls()
|
||||
// Set up log listeners
|
||||
int verbosity;
|
||||
ini.Get("Options", "Verbosity", &verbosity, 0);
|
||||
if (verbosity < 1) verbosity = 1;
|
||||
if (verbosity > MAX_LOGLEVEL) verbosity = MAX_LOGLEVEL;
|
||||
|
||||
// Ensure the verbosity level is valid
|
||||
if (verbosity < 1)
|
||||
verbosity = 1;
|
||||
if (verbosity > MAX_LOGLEVEL)
|
||||
verbosity = MAX_LOGLEVEL;
|
||||
|
||||
// Get the logger output settings from the config ini file.
|
||||
ini.Get("Options", "WriteToFile", &m_writeFile, false);
|
||||
ini.Get("Options", "WriteToConsole", &m_writeConsole, true);
|
||||
ini.Get("Options", "WriteToWindow", &m_writeWindow, true);
|
||||
@@ -80,6 +85,7 @@ void CLogWindow::CreateGUIControls()
|
||||
{
|
||||
m_writeDebugger = false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
|
||||
{
|
||||
bool enable;
|
||||
|
||||
@@ -218,7 +218,7 @@ bool DolphinApp::OnInit()
|
||||
RegisterMsgAlertHandler(&wxMsgAlert);
|
||||
RegisterStringTranslator(&wxStringTranslator);
|
||||
|
||||
// "ExtendedTrace" looks freakin dangerous!!!
|
||||
// "ExtendedTrace" looks freakin' dangerous!!!
|
||||
#ifdef _WIN32
|
||||
EXTENDEDTRACEINITIALIZE(".");
|
||||
SetUnhandledExceptionFilter(&MyUnhandledExceptionFilter);
|
||||
@@ -239,7 +239,7 @@ bool DolphinApp::OnInit()
|
||||
#ifdef __APPLE__
|
||||
if (floor(NSAppKitVersionNumber) < NSAppKitVersionNumber10_7)
|
||||
{
|
||||
PanicAlertT("Hi,\n\nDolphin requires OS X 10.7 or greater.\n"
|
||||
PanicAlertT("Hi,\n\nDolphin requires Mac OS X 10.7 or greater.\n"
|
||||
"Unfortunately you're running an old version of OS X.\n"
|
||||
"The last Dolphin version to support OS X 10.6 is Dolphin 3.5\n"
|
||||
"Please upgrade to 10.7 or greater to use the newest Dolphin version.\n\n"
|
||||
@@ -251,7 +251,7 @@ bool DolphinApp::OnInit()
|
||||
#ifdef _WIN32
|
||||
if (!wxSetWorkingDirectory(StrToWxStr(File::GetExeDirectory())))
|
||||
{
|
||||
INFO_LOG(CONSOLE, "set working directory failed");
|
||||
INFO_LOG(CONSOLE, "Set working directory failed");
|
||||
}
|
||||
#else
|
||||
//create all necessary directories in user directory
|
||||
@@ -313,7 +313,7 @@ bool DolphinApp::OnInit()
|
||||
MessageBox(NULL,
|
||||
L"This version of Dolphin was downloaded from a website stealing money from developers of the emulator. Please "
|
||||
L"download Dolphin from the official website instead: http://dolphin-emu.org/",
|
||||
L"Unofficial version detected", MB_OK | MB_ICONWARNING);
|
||||
L"Unofficial version detected", MB_OK | MB_ICONWARNING);
|
||||
ShellExecute(NULL, L"open", L"http://dolphin-emu.org/?ref=badver", NULL, NULL, SW_SHOWDEFAULT);
|
||||
exit(0);
|
||||
}
|
||||
@@ -376,7 +376,9 @@ void DolphinApp::AfterInit(wxTimerEvent& WXUNUSED(event))
|
||||
main_frame->BootGame(WxStrToStr(FileToLoad));
|
||||
}
|
||||
else
|
||||
{
|
||||
main_frame->BootGame(std::string(""));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -516,7 +518,7 @@ void* Host_GetInstance()
|
||||
|
||||
void* Host_GetRenderHandle()
|
||||
{
|
||||
return main_frame->GetRenderHandle();
|
||||
return main_frame->GetRenderHandle();
|
||||
}
|
||||
|
||||
// OK, this thread boundary is DANGEROUS on linux
|
||||
@@ -627,7 +629,7 @@ void Host_SetStartupDebuggingParameters()
|
||||
{
|
||||
SCoreStartupParameter& StartUp = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||
if (main_frame->g_pCodeWindow)
|
||||
{
|
||||
{
|
||||
StartUp.bBootToPause = main_frame->g_pCodeWindow->BootToPause();
|
||||
StartUp.bAutomaticStart = main_frame->g_pCodeWindow->AutomaticStart();
|
||||
StartUp.bJITNoBlockCache = main_frame->g_pCodeWindow->JITNoBlockCache();
|
||||
|
||||
@@ -466,7 +466,7 @@ bool CMemcardManager::CopyDeleteSwitch(u32 error, int slot)
|
||||
break;
|
||||
case DELETE_FAIL:
|
||||
PanicAlertT("Order of files in the File Directory do not match the block order\n"
|
||||
"Right click and export all of the saves,\nand import the the saves to a new memcard\n");
|
||||
"Right click and export all of the saves,\nand import the saves to a new memcard\n");
|
||||
break;
|
||||
default:
|
||||
PanicAlert(E_UNK);
|
||||
@@ -508,7 +508,10 @@ void CMemcardManager::CopyDeleteClick(wxCommandEvent& event)
|
||||
{
|
||||
SuccessAlertT("The checksum was successfully fixed");
|
||||
}
|
||||
else PanicAlert(E_SAVEFAILED);
|
||||
else
|
||||
{
|
||||
PanicAlert(E_SAVEFAILED);
|
||||
}
|
||||
break;
|
||||
case ID_CONVERTTOGCI:
|
||||
fileName2 = "convert";
|
||||
@@ -533,7 +536,10 @@ void CMemcardManager::CopyDeleteClick(wxCommandEvent& event)
|
||||
wxEmptyString, wxEmptyString, wxT(".gci"),
|
||||
_("GCI File(*.gci)") + wxString(_T("|*.gci")),
|
||||
wxFD_OVERWRITE_PROMPT|wxFD_SAVE, this);
|
||||
if (temp2.empty()) break;
|
||||
|
||||
if (temp2.empty())
|
||||
break;
|
||||
|
||||
fileName2 = WxStrToStr(temp2);
|
||||
}
|
||||
if (fileName.length() > 0)
|
||||
@@ -552,7 +558,7 @@ void CMemcardManager::CopyDeleteClick(wxCommandEvent& event)
|
||||
std::string gciFilename;
|
||||
if (!memoryCard[slot]->GCI_FileName(index, gciFilename))
|
||||
{
|
||||
PanicAlert("invalid index");
|
||||
PanicAlert("Invalid index");
|
||||
return;
|
||||
}
|
||||
wxString fileName = wxFileSelector(
|
||||
@@ -610,7 +616,8 @@ bool CMemcardManager::ReloadMemcard(const char *fileName, int card)
|
||||
// TODO: add error checking and animate icons
|
||||
memoryCard[card] = new GCMemcard(fileName);
|
||||
|
||||
if (!memoryCard[card]->IsValid()) return false;
|
||||
if (!memoryCard[card]->IsValid())
|
||||
return false;
|
||||
|
||||
int j;
|
||||
|
||||
@@ -671,7 +678,10 @@ bool CMemcardManager::ReloadMemcard(const char *fileName, int card)
|
||||
{
|
||||
memset(pxdata,0,96*32*4);
|
||||
int frames=3;
|
||||
if (numFrames<frames) frames=numFrames;
|
||||
|
||||
if (numFrames<frames)
|
||||
frames=numFrames;
|
||||
|
||||
for (int f=0;f<frames;f++)
|
||||
{
|
||||
for (int y=0;y<32;y++)
|
||||
@@ -714,7 +724,10 @@ bool CMemcardManager::ReloadMemcard(const char *fileName, int card)
|
||||
m_MemcardList[card]->SetItem(index, COLUMN_COMMENT, wxComment);
|
||||
|
||||
blocks = memoryCard[card]->DEntry_BlockCount(fileIndex);
|
||||
if (blocks == 0xFFFF) blocks = 0;
|
||||
|
||||
if (blocks == 0xFFFF)
|
||||
blocks = 0;
|
||||
|
||||
wxBlock.Printf(wxT("%10d"), blocks);
|
||||
m_MemcardList[card]->SetItem(index,COLUMN_BLOCKS, wxBlock);
|
||||
firstblock = memoryCard[card]->DEntry_FirstBlock(fileIndex);
|
||||
@@ -801,7 +814,7 @@ void CMemcardManager::CMemcardListCtrl::OnRightClick(wxMouseEvent& event)
|
||||
popupMenu->Append(ID_NEXTPAGE_A + slot, _("Next Page"));
|
||||
popupMenu->Append(ID_MEMCARDPATH_A + slot, wxString::Format(_("Set as default Memcard %c"), 'A' + slot));
|
||||
popupMenu->AppendCheckItem(ID_USEPAGES, _("Enable pages"));
|
||||
|
||||
|
||||
popupMenu->FindItem(ID_PREVPAGE_A + slot)->Enable(prevPage && __mcmSettings.usePages);
|
||||
popupMenu->FindItem(ID_NEXTPAGE_A + slot)->Enable(nextPage && __mcmSettings.usePages);
|
||||
popupMenu->FindItem(ID_USEPAGES)->Check(__mcmSettings.usePages);
|
||||
|
||||
@@ -43,7 +43,7 @@ CWiiSaveCrypted::CWiiSaveCrypted(const char* FileName, u64 TitleID)
|
||||
|
||||
if (!TitleID) // Import
|
||||
{
|
||||
AES_set_decrypt_key(SDKey, 128, &m_AES_KEY);
|
||||
AES_set_decrypt_key(SDKey, 128, &m_AES_KEY);
|
||||
do
|
||||
{
|
||||
b_valid = true;
|
||||
@@ -56,12 +56,15 @@ CWiiSaveCrypted::CWiiSaveCrypted(const char* FileName, u64 TitleID)
|
||||
SuccessAlertT("Successfully imported save files");
|
||||
b_tryAgain = false;
|
||||
}
|
||||
else b_tryAgain = AskYesNoT("Import failed, try again?");
|
||||
}while(b_tryAgain);
|
||||
else
|
||||
{
|
||||
b_tryAgain = AskYesNoT("Import failed, try again?");
|
||||
}
|
||||
} while(b_tryAgain);
|
||||
}
|
||||
else
|
||||
{
|
||||
AES_set_encrypt_key(SDKey, 128, &m_AES_KEY);
|
||||
AES_set_encrypt_key(SDKey, 128, &m_AES_KEY);
|
||||
|
||||
if (getPaths(true))
|
||||
{
|
||||
@@ -77,8 +80,11 @@ CWiiSaveCrypted::CWiiSaveCrypted(const char* FileName, u64 TitleID)
|
||||
SuccessAlertT("Successfully exported file to %s", pathData_bin);
|
||||
b_tryAgain = false;
|
||||
}
|
||||
else b_tryAgain = AskYesNoT("Export failed, try again?");
|
||||
}while(b_tryAgain);
|
||||
else
|
||||
{
|
||||
b_tryAgain = AskYesNoT("Export failed, try again?");
|
||||
}
|
||||
} while(b_tryAgain);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -94,7 +100,7 @@ void CWiiSaveCrypted::ReadHDR()
|
||||
}
|
||||
if (!fpData_bin.ReadBytes(&_encryptedHeader, HEADER_SZ))
|
||||
{
|
||||
PanicAlertT("failed to read header");
|
||||
PanicAlertT("Failed to read header");
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
@@ -105,7 +111,7 @@ void CWiiSaveCrypted::ReadHDR()
|
||||
if ((_bannerSize < FULL_BNR_MIN) || (_bannerSize > FULL_BNR_MAX) ||
|
||||
(((_bannerSize - BNR_SZ) % ICON_SZ) != 0))
|
||||
{
|
||||
PanicAlertT("not a wii save or read failure for file header size %x", _bannerSize);
|
||||
PanicAlertT("Not a Wii save or read failure for file header size %x", _bannerSize);
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
@@ -127,7 +133,7 @@ void CWiiSaveCrypted::ReadHDR()
|
||||
}
|
||||
if (!File::Exists(BannerFilePath) || AskYesNoT("%s already exists, overwrite?", BannerFilePath.c_str()))
|
||||
{
|
||||
INFO_LOG(CONSOLE, "creating file %s", BannerFilePath.c_str());
|
||||
INFO_LOG(CONSOLE, "Creating file %s", BannerFilePath.c_str());
|
||||
File::IOFile fpBanner_bin(BannerFilePath, "wb");
|
||||
fpBanner_bin.WriteBytes(_header.BNR, _bannerSize);
|
||||
}
|
||||
@@ -182,7 +188,7 @@ void CWiiSaveCrypted::ReadBKHDR()
|
||||
fpData_bin.Seek(HEADER_SZ, SEEK_SET);
|
||||
if (!fpData_bin.ReadBytes(&bkhdr, BK_SZ))
|
||||
{
|
||||
PanicAlertT("failed to read bk header");
|
||||
PanicAlertT("Failed to read bk header");
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
@@ -203,7 +209,7 @@ void CWiiSaveCrypted::ReadBKHDR()
|
||||
if (_sizeOfFiles + FULL_CERT_SZ != _totalSize)
|
||||
WARN_LOG(CONSOLE, "Size(%x) + cert(%x) does not equal totalsize(%x)", _sizeOfFiles, FULL_CERT_SZ, _totalSize);
|
||||
if (m_TitleID != Common::swap64(bkhdr.SaveGameTitle))
|
||||
WARN_LOG(CONSOLE, "encrypted title (%llx) does not match unencrypted title (%llx)", m_TitleID, Common::swap64(bkhdr.SaveGameTitle));
|
||||
WARN_LOG(CONSOLE, "Encrypted title (%llx) does not match unencrypted title (%llx)", m_TitleID, Common::swap64(bkhdr.SaveGameTitle));
|
||||
}
|
||||
|
||||
void CWiiSaveCrypted::WriteBKHDR()
|
||||
@@ -253,7 +259,7 @@ void CWiiSaveCrypted::ImportWiiSaveFiles()
|
||||
memset(IV, 0, 0x10);
|
||||
_fileSize = 0;
|
||||
|
||||
if (!fpData_bin.ReadBytes(&_tmpFileHDR, FILE_HDR_SZ))
|
||||
if (!fpData_bin.ReadBytes(&_tmpFileHDR, FILE_HDR_SZ))
|
||||
{
|
||||
PanicAlertT("Failed to write header for file %d", i);
|
||||
b_valid = false;
|
||||
@@ -295,11 +301,11 @@ void CWiiSaveCrypted::ImportWiiSaveFiles()
|
||||
|
||||
if (!File::Exists(fullFilePath) || AskYesNoT("%s already exists, overwrite?", fullFilePath.c_str()))
|
||||
{
|
||||
INFO_LOG(CONSOLE, "creating file %s", fullFilePath.c_str());
|
||||
INFO_LOG(CONSOLE, "Creating file %s", fullFilePath.c_str());
|
||||
|
||||
File::IOFile fpRawSaveFile(fullFilePath, "wb");
|
||||
fpRawSaveFile.WriteBytes(_data, _fileSize);
|
||||
}
|
||||
}
|
||||
delete []_data;
|
||||
}
|
||||
}
|
||||
@@ -333,7 +339,6 @@ void CWiiSaveCrypted::ExportWiiSaveFiles()
|
||||
|
||||
for (Common::replace_v::const_iterator iter = replacements.begin(); iter != replacements.end(); ++iter)
|
||||
{
|
||||
|
||||
for (size_t j = 0; (j = __name.find(iter->second, j)) != __name.npos; ++j)
|
||||
{
|
||||
__name.replace(j, iter->second.length(), 1, iter->first);
|
||||
@@ -372,7 +377,7 @@ void CWiiSaveCrypted::ExportWiiSaveFiles()
|
||||
memset(__data, 0, _roundedfileSize);
|
||||
if (!fpRawSaveFile.ReadBytes(__data, _fileSize))
|
||||
{
|
||||
PanicAlertT("failed to read data from file: %s", FilesList[i].c_str());
|
||||
PanicAlertT("Failed to read data from file: %s", FilesList[i].c_str());
|
||||
b_valid = false;
|
||||
}
|
||||
|
||||
@@ -472,7 +477,7 @@ void CWiiSaveCrypted::make_ec_cert(u8 *cert, u8 *sig, char *signer, char *name,
|
||||
{
|
||||
memset(cert, 0, 0x180);
|
||||
*(u32*)cert = Common::swap32(0x10002);
|
||||
|
||||
|
||||
memcpy(cert + 4, sig, 60);
|
||||
strcpy((char*)cert + 0x80, signer);
|
||||
*(u32*)(cert + 0xc0) = Common::swap32(2);
|
||||
@@ -484,17 +489,18 @@ void CWiiSaveCrypted::make_ec_cert(u8 *cert, u8 *sig, char *signer, char *name,
|
||||
bool CWiiSaveCrypted::getPaths(bool forExport)
|
||||
{
|
||||
if (m_TitleID)
|
||||
{
|
||||
{
|
||||
WiiTitlePath = Common::GetTitleDataPath(m_TitleID);
|
||||
BannerFilePath = WiiTitlePath + "banner.bin";
|
||||
}
|
||||
|
||||
if (forExport)
|
||||
{
|
||||
char GameID[5];
|
||||
sprintf(GameID, "%c%c%c%c",
|
||||
(u8)(m_TitleID >> 24) & 0xFF, (u8)(m_TitleID >> 16) & 0xFF,
|
||||
(u8)(m_TitleID >> 8) & 0xFF, (u8)m_TitleID & 0xFF);
|
||||
|
||||
|
||||
if(!File::IsDirectory(WiiTitlePath))
|
||||
{
|
||||
b_valid = false;
|
||||
@@ -530,7 +536,10 @@ void CWiiSaveCrypted::ScanForFiles(std::string savDir, std::vector<std::string>&
|
||||
Directories.push_back(savDir);
|
||||
for (u32 i = 0; i < Directories.size(); i++)
|
||||
{
|
||||
if (i) FileList.push_back(Directories[i]);//add dir to fst
|
||||
if (i != 0)
|
||||
{
|
||||
FileList.push_back(Directories[i]);//add dir to fst
|
||||
}
|
||||
|
||||
File::FSTEntry FST_Temp;
|
||||
File::ScanDirectoryTree(Directories[i], FST_Temp);
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
// --- this is used for encrypted Wii save files
|
||||
|
||||
|
||||
|
||||
class CWiiSaveCrypted
|
||||
{
|
||||
public:
|
||||
@@ -40,8 +39,7 @@ public:
|
||||
void ImportWiiSaveFiles();
|
||||
void ExportWiiSaveFiles(); // To data.bin
|
||||
void do_sig();
|
||||
void make_ec_cert(u8 *cert, u8 *sig, char *signer, char *name, u8 *priv,
|
||||
u32 key_id);
|
||||
void make_ec_cert(u8 *cert, u8 *sig, char *signer, char *name, u8 *priv, u32 key_id);
|
||||
bool getPaths(bool forExport = false);
|
||||
void ScanForFiles(std::string savDir, std::vector<std::string>&FilesList, u32 *_numFiles, u32 *_sizeFiles);
|
||||
|
||||
@@ -49,7 +47,7 @@ private:
|
||||
AES_KEY m_AES_KEY;
|
||||
u8 SD_IV[0x10];
|
||||
std::vector<std::string> FilesList;
|
||||
|
||||
|
||||
char pathData_bin[2048];
|
||||
|
||||
std::string BannerFilePath,
|
||||
@@ -85,13 +83,12 @@ private:
|
||||
BK_LISTED_SZ = 0x70, // Size before rounding to nearest block
|
||||
BK_SZ = 0x80,
|
||||
FILE_HDR_SZ = 0x80,
|
||||
|
||||
|
||||
SIG_SZ = 0x40,
|
||||
NG_CERT_SZ = 0x180,
|
||||
AP_CERT_SZ = 0x180,
|
||||
FULL_CERT_SZ = 0x3C0, // SIG_SZ + NG_CERT_SZ + AP_CERT_SZ + 0x80?
|
||||
|
||||
|
||||
|
||||
BK_HDR_MAGIC = 0x426B0001,
|
||||
FILE_HDR_MAGIC = 0x03adf17e
|
||||
};
|
||||
@@ -107,7 +104,7 @@ private:
|
||||
u8 Md5[0x10]; // md5 of plaintext header with md5 blanker applied
|
||||
u16 unk2;
|
||||
};
|
||||
|
||||
|
||||
struct HEADER
|
||||
{
|
||||
Data_Bin_HDR hdr;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "NetPlay.h"
|
||||
#include "NetWindow.h"
|
||||
#include "Frame.h"
|
||||
#include "Core.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
@@ -106,8 +107,20 @@ NetPlaySetupDiag::NetPlaySetupDiag(wxWindow* const parent, const CGameListCtrl*
|
||||
connect_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlaySetupDiag::OnJoin, this);
|
||||
|
||||
wxStaticText* const alert_lbl = new wxStaticText(connect_tab, wxID_ANY,
|
||||
_("ALERT:\n\nNetPlay will currently only work properly when using the following settings:\n - Dual Core [OFF]\n - Audio Throttle [OFF]\n - DSP-HLE with \"Null Audio\" or DSP-LLE\n - Manually set the exact number of controllers that will be used to [Standard Controller]\n\nAll players should try to use the same Dolphin version and settings.\nDisable all memory cards or send them to all players before starting.\nWiimote support has not been implemented.\n\nYou must forward TCP port to host!!"),
|
||||
wxDefaultPosition, wxDefaultSize);
|
||||
_("ALERT:\n\n"
|
||||
"Netplay will only work with the following settings:\n"
|
||||
" - Enable Dual Core [OFF]\n"
|
||||
" - DSP Emulator Engine Must be the same on all computers!\n"
|
||||
" - DSP on Dedicated Thread [OFF]\n"
|
||||
" - Framelimit NOT set to [Audio]\n"
|
||||
" - Manually set the exact number of controllers to be used to [Standard Controller]\n"
|
||||
"\n"
|
||||
"All players should use the same Dolphin version and settings.\n"
|
||||
"All memory cards must be identical between players or disabled.\n"
|
||||
"Wiimote support has not been implemented!\n"
|
||||
"\n"
|
||||
"The host must have the chosen TCP port open/forwarded!\n"),
|
||||
wxDefaultPosition, wxDefaultSize);
|
||||
|
||||
wxBoxSizer* const top_szr = new wxBoxSizer(wxHORIZONTAL);
|
||||
top_szr->Add(ip_lbl, 0, wxCENTER | wxRIGHT, 5);
|
||||
@@ -138,7 +151,7 @@ NetPlaySetupDiag::NetPlaySetupDiag(wxWindow* const parent, const CGameListCtrl*
|
||||
wxButton* const host_btn = new wxButton(host_tab, wxID_ANY, _("Host"));
|
||||
host_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlaySetupDiag::OnHost, this);
|
||||
|
||||
m_game_lbox = new wxListBox(host_tab, wxID_ANY);
|
||||
m_game_lbox = new wxListBox(host_tab, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxLB_SORT);
|
||||
m_game_lbox->Bind(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, &NetPlaySetupDiag::OnHost, this);
|
||||
|
||||
FillWithGameNames(m_game_lbox, *game_list);
|
||||
@@ -296,7 +309,7 @@ NetPlayDiag::NetPlayDiag(wxWindow* const parent, const CGameListCtrl* const game
|
||||
chat_szr->Add(m_chat_text, 1, wxEXPAND);
|
||||
chat_szr->Add(chat_msg_szr, 0, wxEXPAND | wxTOP, 5);
|
||||
|
||||
m_player_lbox = new wxListBox(panel, wxID_ANY, wxDefaultPosition, wxSize(192,-1));
|
||||
m_player_lbox = new wxListBox(panel, wxID_ANY, wxDefaultPosition, wxSize(256, -1));
|
||||
|
||||
wxStaticBoxSizer* const player_szr = new wxStaticBoxSizer(wxVERTICAL, panel, _("Players"));
|
||||
player_szr->Add(m_player_lbox, 1, wxEXPAND);
|
||||
@@ -329,12 +342,13 @@ NetPlayDiag::NetPlayDiag(wxWindow* const parent, const CGameListCtrl* const game
|
||||
wxSpinCtrl* const padbuf_spin = new wxSpinCtrl(panel, wxID_ANY, wxT("20")
|
||||
, wxDefaultPosition, wxSize(64, -1), wxSP_ARROW_KEYS, 0, 200, 20);
|
||||
padbuf_spin->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &NetPlayDiag::OnAdjustBuffer, this);
|
||||
wxButton* const padbuf_btn = new wxButton(panel, wxID_ANY, wxT("?"), wxDefaultPosition, wxSize(22, -1));
|
||||
padbuf_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlayDiag::OnPadBuffHelp, this);
|
||||
bottom_szr->Add(padbuf_spin, 0, wxCENTER);
|
||||
bottom_szr->Add(padbuf_btn);
|
||||
}
|
||||
|
||||
|
||||
m_memcard_write = new wxCheckBox(panel, wxID_ANY, _("Write memcards (GC)"));
|
||||
m_memcard_write->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &NetPlayDiag::OnMemcardWriteCheck, this);
|
||||
bottom_szr->Add(m_memcard_write, 0, wxCENTER);
|
||||
|
||||
bottom_szr->AddStretchSpacer(1);
|
||||
bottom_szr->Add(quit_btn);
|
||||
|
||||
@@ -397,6 +411,8 @@ void NetPlayDiag::OnStop(wxCommandEvent&)
|
||||
void NetPlayDiag::BootGame(const std::string& filename)
|
||||
{
|
||||
main_frame->BootGame(filename);
|
||||
|
||||
Core::g_CoreStartupParameter.bEnableMemcardSaving = m_memcard_write->GetValue();
|
||||
}
|
||||
|
||||
void NetPlayDiag::StopGame()
|
||||
@@ -438,15 +454,9 @@ void NetPlayDiag::OnMsgStopGame()
|
||||
GetEventHandler()->AddPendingEvent(evt);
|
||||
}
|
||||
|
||||
void NetPlayDiag::OnPadBuffHelp(wxCommandEvent&)
|
||||
void NetPlayDiag::OnMemcardWriteCheck(wxCommandEvent &event)
|
||||
{
|
||||
const u64 time = ((NetPlayServer*)netplay_ptr)->CalculateMinimumBufferTime();
|
||||
std::ostringstream ss;
|
||||
ss << "< Calculated from pings: required buffer: "
|
||||
<< time * (60.0f/1000) << "(60fps) / "
|
||||
<< time * (50.0f/1000) << "(50fps) >\n";
|
||||
|
||||
m_chat_text->AppendText(StrToWxStr(ss.str()));
|
||||
netplay_ptr->SetMemcardWriteEnabled(m_memcard_write->GetValue());
|
||||
}
|
||||
|
||||
void NetPlayDiag::OnAdjustBuffer(wxCommandEvent& event)
|
||||
@@ -556,7 +566,7 @@ ChangeGameDiag::ChangeGameDiag(wxWindow* const parent, const CGameListCtrl* cons
|
||||
: wxDialog(parent, wxID_ANY, _("Change Game"), wxDefaultPosition, wxDefaultSize)
|
||||
, m_game_name(game_name)
|
||||
{
|
||||
m_game_lbox = new wxListBox(this, wxID_ANY);
|
||||
m_game_lbox = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxLB_SORT);
|
||||
m_game_lbox->Bind(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, &ChangeGameDiag::OnPick, this);
|
||||
|
||||
FillWithGameNames(m_game_lbox, *game_list);
|
||||
|
||||
@@ -95,7 +95,7 @@ private:
|
||||
|
||||
void OnChat(wxCommandEvent& event);
|
||||
void OnQuit(wxCommandEvent& event);
|
||||
void OnPadBuffHelp(wxCommandEvent& event);
|
||||
void OnMemcardWriteCheck(wxCommandEvent& event);
|
||||
void OnThread(wxCommandEvent& event);
|
||||
void OnChangeGame(wxCommandEvent& event);
|
||||
void OnAdjustBuffer(wxCommandEvent& event);
|
||||
@@ -104,6 +104,7 @@ private:
|
||||
wxListBox* m_player_lbox;
|
||||
wxTextCtrl* m_chat_text;
|
||||
wxTextCtrl* m_chat_msg_text;
|
||||
wxCheckBox* m_memcard_write;
|
||||
|
||||
std::string m_selected_game;
|
||||
wxButton* m_game_btn;
|
||||
|
||||
@@ -49,8 +49,8 @@ void CPatchAddEdit::CreateGUIControls(int _selection)
|
||||
}
|
||||
else
|
||||
{
|
||||
currentName = StrToWxStr(onFrame.at(_selection).name);
|
||||
tempEntries = onFrame.at(_selection).entries;
|
||||
currentName = StrToWxStr(onFrame.at(_selection).name);
|
||||
tempEntries = onFrame.at(_selection).entries;
|
||||
}
|
||||
|
||||
itCurEntry = tempEntries.begin();
|
||||
@@ -218,7 +218,9 @@ bool CPatchAddEdit::UpdateTempEntryData(std::vector<PatchEngine::PatchEntry>::it
|
||||
parsed_ok = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
parsed_ok = false;
|
||||
}
|
||||
|
||||
if (!parsed_ok)
|
||||
{
|
||||
|
||||
@@ -73,7 +73,7 @@ TASInputDlg::TASInputDlg(wxWindow *parent, wxWindowID id, const wxString &title,
|
||||
main_yslider_box->Add(wx_mainY_s, 0, wxALIGN_CENTER_VERTICAL);
|
||||
main_yslider_box->Add(wx_mainY_t, 0, wxALIGN_CENTER_VERTICAL);
|
||||
main_box->Add(main_yslider_box);
|
||||
|
||||
|
||||
wxStaticBoxSizer* const c_box = new wxStaticBoxSizer(wxHORIZONTAL, this, _("C Stick"));
|
||||
wxBoxSizer* const c_xslider_box = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer* const c_yslider_box = new wxBoxSizer(wxVERTICAL);
|
||||
@@ -686,13 +686,13 @@ bool TASInputDlg::HasFocus()
|
||||
if(TextBoxHasFocus())
|
||||
return false;
|
||||
|
||||
if (wxWindow::FindFocus() == this)
|
||||
return true;
|
||||
else if (wxWindow::FindFocus() != NULL &&
|
||||
wxWindow::FindFocus()->GetParent() == this)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
if (wxWindow::FindFocus() == this)
|
||||
return true;
|
||||
else if (wxWindow::FindFocus() != NULL &&
|
||||
wxWindow::FindFocus()->GetParent() == this)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TASInputDlg::TextBoxHasFocus()
|
||||
@@ -825,6 +825,7 @@ void TASInputDlg::SetTurboFalse(wxMouseEvent& event)
|
||||
case ID_A:
|
||||
A_turbo = false;
|
||||
break;
|
||||
|
||||
case ID_B:
|
||||
B_turbo = false;
|
||||
break;
|
||||
@@ -868,6 +869,7 @@ void TASInputDlg::SetTurboFalse(wxMouseEvent& event)
|
||||
case ID_RIGHT:
|
||||
DR_turbo = false;
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
@@ -989,7 +991,6 @@ void TASInputDlg::ButtonTurbo()
|
||||
{
|
||||
if(wx_a_button->GetValue())
|
||||
wx_a_button->SetValue(false);
|
||||
|
||||
else
|
||||
wx_a_button->SetValue(true);
|
||||
}
|
||||
@@ -998,42 +999,38 @@ void TASInputDlg::ButtonTurbo()
|
||||
{
|
||||
if(wx_b_button->GetValue())
|
||||
wx_b_button->SetValue(false);
|
||||
|
||||
else
|
||||
wx_b_button->SetValue(true);
|
||||
}
|
||||
|
||||
|
||||
if(X_turbo)
|
||||
{
|
||||
if(wx_x_button->GetValue())
|
||||
wx_x_button->SetValue(false);
|
||||
|
||||
else
|
||||
wx_x_button->SetValue(true);
|
||||
}
|
||||
|
||||
|
||||
if(Y_turbo)
|
||||
{
|
||||
if(wx_y_button->GetValue())
|
||||
wx_y_button->SetValue(false);
|
||||
|
||||
else
|
||||
wx_y_button->SetValue(true);
|
||||
}
|
||||
|
||||
|
||||
if(Z_turbo)
|
||||
{
|
||||
if(wx_z_button->GetValue())
|
||||
wx_z_button->SetValue(false);
|
||||
|
||||
else
|
||||
wx_z_button->SetValue(true);
|
||||
}
|
||||
if(L_turbo)
|
||||
|
||||
if(L_turbo)
|
||||
{
|
||||
if(wx_l_button->GetValue())
|
||||
wx_l_button->SetValue(false);
|
||||
|
||||
else
|
||||
wx_l_button->SetValue(true);
|
||||
}
|
||||
@@ -1042,7 +1039,6 @@ void TASInputDlg::ButtonTurbo()
|
||||
{
|
||||
if(wx_r_button->GetValue())
|
||||
wx_r_button->SetValue(false);
|
||||
|
||||
else
|
||||
wx_r_button->SetValue(true);
|
||||
}
|
||||
@@ -1051,7 +1047,6 @@ void TASInputDlg::ButtonTurbo()
|
||||
{
|
||||
if(wx_start_button->GetValue())
|
||||
wx_start_button->SetValue(false);
|
||||
|
||||
else
|
||||
wx_start_button->SetValue(true);
|
||||
}
|
||||
@@ -1060,7 +1055,6 @@ void TASInputDlg::ButtonTurbo()
|
||||
{
|
||||
if(wx_up_button->GetValue())
|
||||
wx_up_button->SetValue(false);
|
||||
|
||||
else
|
||||
wx_up_button->SetValue(true);
|
||||
}
|
||||
@@ -1069,7 +1063,6 @@ void TASInputDlg::ButtonTurbo()
|
||||
{
|
||||
if(wx_down_button->GetValue())
|
||||
wx_down_button->SetValue(false);
|
||||
|
||||
else
|
||||
wx_down_button->SetValue(true);
|
||||
}
|
||||
@@ -1078,7 +1071,6 @@ void TASInputDlg::ButtonTurbo()
|
||||
{
|
||||
if(wx_left_button->GetValue())
|
||||
wx_left_button->SetValue(false);
|
||||
|
||||
else
|
||||
wx_left_button->SetValue(true);
|
||||
}
|
||||
@@ -1087,7 +1079,6 @@ void TASInputDlg::ButtonTurbo()
|
||||
{
|
||||
if(wx_right_button->GetValue())
|
||||
wx_right_button->SetValue(false);
|
||||
|
||||
else
|
||||
wx_right_button->SetValue(true);
|
||||
}
|
||||
@@ -1097,13 +1088,13 @@ wxBitmap TASInputDlg::CreateStickBitmap(int x, int y)
|
||||
{
|
||||
x = x/2;
|
||||
y = y/2;
|
||||
|
||||
|
||||
wxMemoryDC memDC;
|
||||
wxBitmap stick_bitmap(127, 127);
|
||||
memDC.SelectObject(stick_bitmap);
|
||||
memDC.SetBackground(*wxLIGHT_GREY_BRUSH);
|
||||
memDC.Clear();
|
||||
memDC.SetBrush(*wxWHITE_BRUSH);
|
||||
wxBitmap stick_bitmap(127, 127);
|
||||
memDC.SelectObject(stick_bitmap);
|
||||
memDC.SetBackground(*wxLIGHT_GREY_BRUSH);
|
||||
memDC.Clear();
|
||||
memDC.SetBrush(*wxWHITE_BRUSH);
|
||||
memDC.DrawCircle(65,65,64);
|
||||
memDC.SetBrush(*wxRED_BRUSH);
|
||||
memDC.DrawLine(64,64,x,y);
|
||||
@@ -1115,6 +1106,6 @@ wxBitmap TASInputDlg::CreateStickBitmap(int x, int y)
|
||||
memDC.CrossHair(64,64);
|
||||
memDC.SetBrush(*wxBLUE_BRUSH);
|
||||
memDC.DrawCircle(x,y,5);
|
||||
memDC.SelectObject(wxNullBitmap);
|
||||
return stick_bitmap;
|
||||
memDC.SelectObject(wxNullBitmap);
|
||||
return stick_bitmap;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ class TASInputDlg : public wxDialog
|
||||
bool A_turbo,B_turbo, X_turbo, Y_turbo, Z_turbo, L_turbo, R_turbo, START_turbo,DL_turbo,DR_turbo,DD_turbo,DU_turbo;
|
||||
bool A_cont,B_cont, X_cont, Y_cont, Z_cont, L_cont, R_cont, START_cont,DL_cont,DR_cont,DD_cont,DU_cont,mstickx,msticky,cstickx,csticky;
|
||||
int xaxis,yaxis,c_xaxis,c_yaxis,update,update_axis;
|
||||
|
||||
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
||||
|
||||
@@ -66,7 +66,11 @@ void VideoConfigDiag::Event_Close(wxCloseEvent& ev)
|
||||
EndModal(wxID_OK);
|
||||
}
|
||||
|
||||
wxString backend_desc = wxTRANSLATE("Selects what graphics API to use internally.\nDirect3D 9 usually is the fastest one. OpenGL is more accurate though. Direct3D 11 is somewhere between the two.\nNote that the Direct3D backends are only available on Windows.\n\nIf unsure, use Direct3D 9.");
|
||||
#if defined(_WIN32)
|
||||
wxString backend_desc = wxTRANSLATE("Selects what graphics API to use internally.\nDirect3D 9 usually is the fastest one. OpenGL is more accurate though. Direct3D 11 is somewhere between the two.\nNote that the Direct3D backends are only available on Windows.\n\nIf unsure, use Direct3D 11.");
|
||||
#else
|
||||
wxString backend_desc = wxTRANSLATE("Selects what graphics API to use internally.\nDirect3D 9 usually is the fastest one. OpenGL is more accurate though. Direct3D 11 is somewhere between the two.\nNote that the Direct3D backends are only available on Windows.\n\nIf unsure, use OpenGL.");
|
||||
#endif
|
||||
wxString adapter_desc = wxTRANSLATE("Select a hardware adapter to use.\n\nIf unsure, use the first one.");
|
||||
wxString display_res_desc = wxTRANSLATE("Selects the display resolution used in fullscreen mode.\nThis should always be bigger than or equal to the internal resolution. Performance impact is negligible.\n\nIf unsure, use your desktop resolution.\nIf still unsure, use the highest resolution which works for you.");
|
||||
wxString use_fullscreen_desc = wxTRANSLATE("Enable this if you want the whole screen to be used for rendering.\nIf this is disabled, a render window will be created instead.\n\nIf unsure, leave this unchecked.");
|
||||
@@ -93,8 +97,8 @@ wxString efb_copy_texture_desc = wxTRANSLATE("Store EFB copies in GPU texture ob
|
||||
wxString efb_copy_ram_desc = wxTRANSLATE("Accurately emulate EFB copies.\nSome games depend on this for certain graphical effects or gameplay functionality.\n\nIf unsure, check EFB to Texture instead.");
|
||||
wxString stc_desc = wxTRANSLATE("The safer you adjust this, the less likely the emulator will be missing any texture updates from RAM.\n\nIf unsure, use the rightmost value.");
|
||||
wxString wireframe_desc = wxTRANSLATE("Render the scene as a wireframe.\n\nIf unsure, leave this unchecked.");
|
||||
wxString disable_fog_desc = wxTRANSLATE("Improves performance but causes glitches in most games which rely on proper fog emulation.\n\nIf unsure, leave this unchecked.");
|
||||
wxString disable_alphapass_desc = wxTRANSLATE("Skip the destination alpha pass used in many games for various graphical effects.\n\nIf unsure, leave this unchecked.");
|
||||
wxString disable_fog_desc = wxTRANSLATE("Makes distant objects more visible by removing fog, thus increasing the overall detail.\nDisabling fog will break some games which rely on proper fog emulation.\n\nIf unsure, leave this unchecked.");
|
||||
wxString disable_dstalpha_desc = wxTRANSLATE("Disables emulation of a hardware feature called destination alpha, which is used in many games for various graphical effects.\n\nIf unsure, leave this unchecked.");
|
||||
wxString show_fps_desc = wxTRANSLATE("Show the number of frames rendered per second as a measure of emulation speed.\n\nIf unsure, leave this unchecked.");
|
||||
wxString log_fps_to_file_desc = wxTRANSLATE("Log the number of frames rendered per second to User/Logs/fps.txt. Use this feature when you want to measure the performance of Dolphin.\n\nIf unsure, leave this unchecked.");
|
||||
wxString show_input_display_desc = wxTRANSLATE("Display the inputs read by the emulator.\n\nIf unsure, leave this unchecked.");
|
||||
@@ -212,9 +216,9 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
|
||||
it = g_available_video_backends.begin(),
|
||||
itend = g_available_video_backends.end();
|
||||
for (; it != itend; ++it)
|
||||
choice_backend->AppendString(wxGetTranslation(StrToWxStr((*it)->GetName())));
|
||||
choice_backend->AppendString(wxGetTranslation(StrToWxStr((*it)->GetDisplayName())));
|
||||
|
||||
choice_backend->SetStringSelection(wxGetTranslation(StrToWxStr(g_video_backend->GetName())));
|
||||
choice_backend->SetStringSelection(wxGetTranslation(StrToWxStr(g_video_backend->GetDisplayName())));
|
||||
choice_backend->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &VideoConfigDiag::Event_Backend, this);
|
||||
|
||||
szr_basic->Add(label_backend, 1, wxALIGN_CENTER_VERTICAL, 5);
|
||||
@@ -249,6 +253,8 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
|
||||
wxFlexGridSizer* const szr_display = new wxFlexGridSizer(2, 5, 5);
|
||||
|
||||
{
|
||||
|
||||
#if !defined(__APPLE__)
|
||||
// display resolution
|
||||
{
|
||||
wxArrayString res_list = GetListOfResolutions();
|
||||
@@ -270,6 +276,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
|
||||
choice_display_resolution->Disable();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// aspect-ratio
|
||||
{
|
||||
@@ -336,8 +343,8 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
|
||||
// Internal resolution
|
||||
{
|
||||
const wxString efbscale_choices[] = { _("Auto (Window Size)"), _("Auto (Multiple of 640x528)"),
|
||||
wxT("1x Native (640x528)"), wxT("1.5x Native (960x792)"), wxT("2x Native (1280x1056)"),
|
||||
wxT("2.5x Native (1600x1320)"), wxT("3x Native (1920x1584)"), wxT("4x Native (2560x2112)") };
|
||||
_("1x Native (640x528)"), _("1.5x Native (960x792)"), _("2x Native (1280x1056)"),
|
||||
_("2.5x Native (1600x1320)"), _("3x Native (1920x1584)"), _("4x Native (2560x2112)") };
|
||||
|
||||
wxChoice *const choice_efbscale = CreateChoice(page_enh,
|
||||
vconfig.iEFBScale, wxGetTranslation(internal_res_desc), sizeof(efbscale_choices)/sizeof(*efbscale_choices), efbscale_choices);
|
||||
@@ -398,11 +405,13 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
|
||||
szr_enh->Add(pixel_lighting = CreateCheckBox(page_enh, _("Per-Pixel Lighting"), wxGetTranslation(pixel_lighting_desc), vconfig.bEnablePixelLighting));
|
||||
szr_enh->Add(CreateCheckBox(page_enh, _("Force Texture Filtering"), wxGetTranslation(force_filtering_desc), vconfig.bForceFiltering));
|
||||
|
||||
szr_enh->Add(CreateCheckBox(page_enh, _("Widescreen Hack"), wxGetTranslation(ws_hack_desc), vconfig.bWidescreenHack));
|
||||
szr_enh->Add(CreateCheckBox(page_enh, _("Disable Fog"), wxGetTranslation(disable_fog_desc), vconfig.bDisableFog));
|
||||
|
||||
// 3D Vision
|
||||
_3d_vision = CreateCheckBox(page_enh, _("3D Vision"), wxGetTranslation(_3d_vision_desc), vconfig.b3DVision);
|
||||
_3d_vision->Show(vconfig.backend_info.bSupports3DVision);
|
||||
szr_enh->Add(_3d_vision);
|
||||
szr_enh->Add(CreateCheckBox(page_enh, _("Widescreen Hack"), wxGetTranslation(ws_hack_desc), vconfig.bWidescreenHack));
|
||||
// TODO: Add anaglyph 3d here
|
||||
|
||||
wxStaticBoxSizer* const group_enh = new wxStaticBoxSizer(wxVERTICAL, page_enh, _("Enhancements"));
|
||||
@@ -489,8 +498,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
|
||||
wxGridSizer* const szr_other = new wxGridSizer(2, 5, 5);
|
||||
SettingCheckBox* hacked_buffer_upload_cb;
|
||||
szr_other->Add(CreateCheckBox(page_hacks, _("Cache Display Lists"), wxGetTranslation(dlc_desc), vconfig.bDlistCachingEnable));
|
||||
szr_other->Add(CreateCheckBox(page_hacks, _("Disable Fog"), wxGetTranslation(disable_fog_desc), vconfig.bDisableFog));
|
||||
szr_other->Add(CreateCheckBox(page_hacks, _("Skip Dest. Alpha Pass"), wxGetTranslation(disable_alphapass_desc), vconfig.bDstAlphaPass));
|
||||
szr_other->Add(CreateCheckBox(page_hacks, _("Disable Destination Alpha"), wxGetTranslation(disable_dstalpha_desc), vconfig.bDstAlphaPass));
|
||||
szr_other->Add(CreateCheckBox(page_hacks, _("OpenCL Texture Decoder"), wxGetTranslation(opencl_desc), vconfig.bEnableOpenCL));
|
||||
szr_other->Add(CreateCheckBox(page_hacks, _("OpenMP Texture Decoder"), wxGetTranslation(omp_desc), vconfig.bOMPDecoder));
|
||||
szr_other->Add(hacked_buffer_upload_cb = CreateCheckBox(page_hacks, _("Hacked Buffer Upload"), wxGetTranslation(hacked_buffer_upload_desc), vconfig.bHackedBufferUpload));
|
||||
|
||||
Reference in New Issue
Block a user