diff --git a/Source/Core/Common/Common.vcproj b/Source/Core/Common/Common.vcproj
index d14592aada..a83b5eb785 100644
--- a/Source/Core/Common/Common.vcproj
+++ b/Source/Core/Common/Common.vcproj
@@ -602,10 +602,6 @@
RelativePath=".\Src\Plugin.h"
>
-
-
diff --git a/Source/Core/Core/Src/ARDecrypt.cpp b/Source/Core/Core/Src/ARDecrypt.cpp
index 5347071111..7ec28254f2 100644
--- a/Source/Core/Core/Src/ARDecrypt.cpp
+++ b/Source/Core/Core/Src/ARDecrypt.cpp
@@ -22,6 +22,9 @@
#include "ARDecrypt.h"
#include
+namespace ActionReplay
+{
+
int total;
// Alphanumeric filter for text<->bin conversion
@@ -509,3 +512,4 @@ void DecryptARCode(std::vector vCodes, std::vector &ops)
}
}
}
+} //namespace ActionReplay
diff --git a/Source/Core/Core/Src/ARDecrypt.h b/Source/Core/Core/Src/ARDecrypt.h
index 6f6f98dc00..78ab3b7fa9 100644
--- a/Source/Core/Core/Src/ARDecrypt.h
+++ b/Source/Core/Core/Src/ARDecrypt.h
@@ -28,9 +28,13 @@
#include "Common.h"
#include "ActionReplay.h"
+namespace ActionReplay
+{
+
extern int total;
extern const char *filter;
void DecryptARCode(std::vector vCodes, std::vector &ops);
+} //namespace
#endif //_ARDECRYPT_H_
diff --git a/Source/Core/Core/Src/ActionReplay.cpp b/Source/Core/Core/Src/ActionReplay.cpp
index 4b7fccf712..5b4542298f 100644
--- a/Source/Core/Core/Src/ActionReplay.cpp
+++ b/Source/Core/Core/Src/ActionReplay.cpp
@@ -24,6 +24,8 @@
// It probably is Turing complete - but what does that matter when AR codes can write
// actual PowerPC code...
+// THIS FILE IS GROSS!!!
+
#include
#include
@@ -35,16 +37,17 @@
#include "ARDecrypt.h"
#include "LogManager.h"
-namespace
+namespace ActionReplay
{
- static std::vector::const_iterator iter;
- static ARCode code;
- static bool b_RanOnce = false;
- static std::vector arCodes;
- static std::vector activeCodes;
- static bool logSelf = false;
- static std::vector arLog;
-} // namespace
+
+static std::vector::const_iterator iter;
+static ARCode code;
+static bool b_RanOnce = false;
+static std::vector arCodes;
+static std::vector activeCodes;
+static bool logSelf = false;
+static std::vector arLog;
+
void LogInfo(const char *format, ...);
// --- Codes ---
@@ -66,11 +69,11 @@ bool NormalCode_Type_5(u8 subtype, u32 addr, u32 data, int *count, bool *skip);
bool NormalCode_Type_6(u8 subtype, u32 addr, u32 data, int *count, bool *skip);
bool NormalCode_Type_7(u8 subtype, u32 addr, u32 data, int *count, bool *skip);
-void LoadActionReplayCodes(IniFile &ini)
+void LoadCodes(IniFile &ini, bool forceLoad)
{
// Parses the Action Replay section of a game ini file.
- if (!Core::GetStartupParameter().bEnableCheats)
- return; // If cheats are off, do not load them
+ if (!Core::GetStartupParameter().bEnableCheats && !forceLoad)
+ return;
std::vector lines;
std::vector encryptedLines;
@@ -158,7 +161,13 @@ void LoadActionReplayCodes(IniFile &ini)
arCodes.push_back(currentCode);
}
- ActionReplay_UpdateActiveList();
+ UpdateActiveList();
+}
+
+void LoadCodes(std::vector &_arCodes, IniFile &ini)
+{
+ LoadCodes(ini, true);
+ _arCodes = arCodes;
}
void LogInfo(const char *format, ...)
@@ -184,14 +193,14 @@ void LogInfo(const char *format, ...)
}
}
-void ActionReplayRunAllActive()
+void RunAllActive()
{
if (Core::GetStartupParameter().bEnableCheats) {
for (std::vector::iterator iter = activeCodes.begin(); iter != activeCodes.end(); ++iter)
{
if (iter->active)
{
- if (!RunActionReplayCode(*iter))
+ if (!RunCode(*iter))
iter->active = false;
LogInfo("\n");
}
@@ -201,7 +210,7 @@ void ActionReplayRunAllActive()
}
}
-bool RunActionReplayCode(const ARCode &arcode) {
+bool RunCode(const ARCode &arcode) {
// The mechanism is different than what the real AR uses, so there may be compatibility problems.
u8 cmd;
u32 addr;
@@ -999,33 +1008,33 @@ bool NormalCode_Type_7(u8 subtype, u32 addr, u32 data, int *count, bool *skip)
return true;
}
-size_t ActionReplay_GetCodeListSize()
+size_t GetCodeListSize()
{
return arCodes.size();
}
-ARCode ActionReplay_GetARCode(size_t index)
+ARCode GetARCode(size_t index)
{
if (index > arCodes.size())
{
- PanicAlert("ActionReplay_GetARCode: Index is greater than ar code list size %i", index);
+ PanicAlert("GetARCode: Index is greater than ar code list size %i", index);
return ARCode();
}
return arCodes[index];
}
-void ActionReplay_SetARCode_IsActive(bool active, size_t index)
+void SetARCode_IsActive(bool active, size_t index)
{
if (index > arCodes.size())
{
- PanicAlert("ActionReplay_SetARCode_IsActive: Index is greater than ar code list size %i", index);
+ PanicAlert("SetARCode_IsActive: Index is greater than ar code list size %i", index);
return;
}
arCodes[index].active = active;
- ActionReplay_UpdateActiveList();
+ UpdateActiveList();
}
-void ActionReplay_UpdateActiveList()
+void UpdateActiveList()
{
b_RanOnce = false;
activeCodes.clear();
@@ -1036,17 +1045,19 @@ void ActionReplay_UpdateActiveList()
}
}
-void ActionReplay_EnableSelfLogging(bool enable)
+void EnableSelfLogging(bool enable)
{
logSelf = enable;
}
-const std::vector &ActionReplay_GetSelfLog()
+const std::vector &GetSelfLog()
{
return arLog;
}
-bool ActionReplay_IsSelfLogging()
+bool IsSelfLogging()
{
return logSelf;
-}
\ No newline at end of file
+}
+
+} // namespace ActionReplay
diff --git a/Source/Core/Core/Src/ActionReplay.h b/Source/Core/Core/Src/ActionReplay.h
index f7dc634d19..2fde6de1f3 100644
--- a/Source/Core/Core/Src/ActionReplay.h
+++ b/Source/Core/Core/Src/ActionReplay.h
@@ -20,6 +20,9 @@
#include "IniFile.h"
+namespace ActionReplay
+{
+
struct AREntry {
u32 cmd_addr;
u32 value;
@@ -31,15 +34,17 @@ struct ARCode {
bool active;
};
-void ActionReplayRunAllActive();
-bool RunActionReplayCode(const ARCode &arcode);
-void LoadActionReplayCodes(IniFile &ini);
-size_t ActionReplay_GetCodeListSize();
-ARCode ActionReplay_GetARCode(size_t index);
-void ActionReplay_SetARCode_IsActive(bool active, size_t index);
-void ActionReplay_UpdateActiveList();
-void ActionReplay_EnableSelfLogging(bool enable);
-const std::vector &ActionReplay_GetSelfLog();
-bool ActionReplay_IsSelfLogging();
+void RunAllActive();
+bool RunCode(const ARCode &arcode);
+void LoadCodes(IniFile &ini, bool forceLoad);
+void LoadCodes(std::vector &_arCodes, IniFile &ini);
+size_t GetCodeListSize();
+ARCode GetARCode(size_t index);
+void SetARCode_IsActive(bool active, size_t index);
+void UpdateActiveList();
+void EnableSelfLogging(bool enable);
+const std::vector &GetSelfLog();
+bool IsSelfLogging();
+} // namespace
#endif //_ACTIONREPLAY_H_
diff --git a/Source/Core/Core/Src/PatchEngine.cpp b/Source/Core/Core/Src/PatchEngine.cpp
index 16b6117c9c..9a69adff9b 100644
--- a/Source/Core/Core/Src/PatchEngine.cpp
+++ b/Source/Core/Core/Src/PatchEngine.cpp
@@ -136,7 +136,7 @@ void LoadPatches(const char *gameID)
std::string filename = std::string(FULL_GAMECONFIG_DIR) + gameID + ".ini";
if (ini.Load(filename.c_str())) {
LoadPatchSection("OnFrame", onFrame, ini);
- LoadActionReplayCodes(ini);
+ ActionReplay::LoadCodes(ini, false);
LoadSpeedhacks("Speedhacks", speedHacks, ini);
}
}
@@ -178,6 +178,6 @@ void ApplyFramePatches()
void ApplyARPatches()
{
- ActionReplayRunAllActive();
+ ActionReplay::RunAllActive();
}
} // namespace
diff --git a/Source/Core/DolphinWX/DolphinWX.vcproj b/Source/Core/DolphinWX/DolphinWX.vcproj
index 683a623ad7..9c44a01172 100644
--- a/Source/Core/DolphinWX/DolphinWX.vcproj
+++ b/Source/Core/DolphinWX/DolphinWX.vcproj
@@ -768,6 +768,14 @@
RelativePath=".\Src\AboutDolphin.h"
>
+
+
+
+
diff --git a/Source/Core/DolphinWX/Src/ARCodeAddEdit.cpp b/Source/Core/DolphinWX/Src/ARCodeAddEdit.cpp
new file mode 100644
index 0000000000..27e9a85999
--- /dev/null
+++ b/Source/Core/DolphinWX/Src/ARCodeAddEdit.cpp
@@ -0,0 +1,90 @@
+// Copyright (C) 2003-2008 Dolphin Project.
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 2.0.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License 2.0 for more details.
+
+// A copy of the GPL 2.0 should have been included with the program.
+// If not, see http://www.gnu.org/licenses/
+
+// Official SVN repository and contact information can be found at
+// http://code.google.com/p/dolphin-emu/
+
+#include "ARCodeAddEdit.h"
+
+extern std::vector arCodes;
+
+BEGIN_EVENT_TABLE(CARCodeAddEdit, wxDialog)
+ EVT_CLOSE(CARCodeAddEdit::OnClose)
+ EVT_SPIN(ID_ENTRY_SELECT, CARCodeAddEdit::ChangeEntry)
+END_EVENT_TABLE()
+
+CARCodeAddEdit::CARCodeAddEdit(int _selection, wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style)
+ : wxDialog(parent, id, title, position, size, style)
+{
+ selection = _selection;
+ CreateGUIControls(selection);
+}
+
+CARCodeAddEdit::~CARCodeAddEdit()
+{
+}
+
+void CARCodeAddEdit::CreateGUIControls(int _selection)
+{
+ ActionReplay::ARCode currentCode = arCodes.at(_selection);
+
+ wxBoxSizer* sEditCheat = new wxBoxSizer(wxVERTICAL);
+ wxStaticBoxSizer* sbEntry = new wxStaticBoxSizer(wxVERTICAL, this, _("Code"));
+ wxStaticText* EditCheatNameText = new wxStaticText(this, ID_EDITCHEAT_NAME_TEXT, _("Name:"), wxDefaultPosition, wxDefaultSize);
+ EditCheatName = new wxTextCtrl(this, ID_EDITCHEAT_NAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+ EditCheatName->SetValue(wxString::FromAscii(currentCode.name.c_str()));
+ EntrySelection = new wxSpinButton(this, ID_ENTRY_SELECT, wxDefaultPosition, wxDefaultSize, wxVERTICAL);
+ EntrySelection->SetRange(0, (int)arCodes.size()-1);
+ EntrySelection->SetValue(_selection);
+ EditCheatCode = new wxTextCtrl(this, ID_EDITCHEAT_CODE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
+ UpdateTextCtrl(currentCode);
+ wxGridBagSizer* sgEntry = new wxGridBagSizer(0, 0);
+ sgEntry->AddGrowableCol(1);
+ sgEntry->AddGrowableRow(1);
+ sgEntry->Add(EditCheatNameText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5);
+ sgEntry->Add(EditCheatName, wxGBPosition(0, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
+ sgEntry->Add(EntrySelection, wxGBPosition(0, 2), wxGBSpan(2, 1), wxEXPAND|wxALL, 5);
+ sgEntry->Add(EditCheatCode, wxGBPosition(1, 0), wxGBSpan(1, 2), wxEXPAND|wxALL, 5);
+ sbEntry->Add(sgEntry, 1, wxEXPAND);
+ sEditCheat->Add(sbEntry, 1, wxEXPAND|wxALL, 5);
+ wxBoxSizer* sEditCheatButtons = new wxBoxSizer(wxHORIZONTAL);
+ wxButton* bOK = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
+ wxButton* bCancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
+ sEditCheatButtons->Add(0, 0, 1, wxEXPAND, 5);
+ sEditCheatButtons->Add(bOK, 0, wxALL, 5);
+ sEditCheatButtons->Add(bCancel, 0, wxALL, 5);
+ sEditCheat->Add(sEditCheatButtons, 0, wxEXPAND, 5);
+ this->SetSizer(sEditCheat);
+ sEditCheat->Layout();
+}
+
+void CARCodeAddEdit::OnClose(wxCloseEvent& WXUNUSED (event))
+{
+ Destroy();
+}
+
+void CARCodeAddEdit::ChangeEntry(wxSpinEvent& event)
+{
+ ActionReplay::ARCode currentCode = arCodes.at(event.GetPosition());
+ EditCheatName->SetValue(wxString::FromAscii(currentCode.name.c_str()));
+ UpdateTextCtrl(currentCode);
+}
+
+void CARCodeAddEdit::UpdateTextCtrl(ActionReplay::ARCode arCode)
+{
+ EditCheatCode->Clear();
+
+ for (int i = 0; i < arCode.ops.size(); i++)
+ EditCheatCode->AppendText(wxString::Format("%08X %08X\n", arCode.ops.at(i).cmd_addr, arCode.ops.at(i).value));
+}
diff --git a/Source/Core/DolphinWX/Src/ARCodeAddEdit.h b/Source/Core/DolphinWX/Src/ARCodeAddEdit.h
new file mode 100644
index 0000000000..0157488d59
--- /dev/null
+++ b/Source/Core/DolphinWX/Src/ARCodeAddEdit.h
@@ -0,0 +1,58 @@
+// Copyright (C) 2003-2008 Dolphin Project.
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 2.0.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License 2.0 for more details.
+
+// A copy of the GPL 2.0 should have been included with the program.
+// If not, see http://www.gnu.org/licenses/
+
+// Official SVN repository and contact information can be found at
+// http://code.google.com/p/dolphin-emu/
+
+#ifndef __ARCODE_ADDEDIT_h__
+#define __ARCODE_ADDEDIT_h__
+
+#include
+#include
+#include "ISOProperties.h"
+
+class CARCodeAddEdit : public wxDialog
+{
+ public:
+ CARCodeAddEdit(int _selection, wxWindow* parent,
+ wxWindowID id = 1,
+ const wxString& title = wxT("Edit ActionReplay Code"),
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_DIALOG_STYLE);
+ virtual ~CARCodeAddEdit();
+
+ private:
+ DECLARE_EVENT_TABLE();
+
+ wxTextCtrl *EditCheatName;
+ wxSpinButton *EntrySelection;
+ wxTextCtrl *EditCheatCode;
+
+ enum {
+ ID_EDITCHEAT_NAME_TEXT = 4550,
+ ID_EDITCHEAT_NAME,
+ ID_ENTRY_SELECT,
+ ID_EDITCHEAT_CODE
+ };
+
+ void CreateGUIControls(int selection);
+ void OnClose(wxCloseEvent& event);
+ void ChangeEntry(wxSpinEvent& event);
+ void UpdateTextCtrl(ActionReplay::ARCode arCode);
+
+ int selection;
+
+};
+#endif // __PATCH_ADDEDIT_h__
diff --git a/Source/Core/DolphinWX/Src/AboutDolphin.h b/Source/Core/DolphinWX/Src/AboutDolphin.h
index a50d49f260..e612a85c9b 100644
--- a/Source/Core/DolphinWX/Src/AboutDolphin.h
+++ b/Source/Core/DolphinWX/Src/AboutDolphin.h
@@ -25,13 +25,15 @@
#include
#include
-#undef ABOUTDOLPHIN_STYLE
-#define ABOUTDOLPHIN_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX
-
class AboutDolphin : public wxDialog
{
public:
- AboutDolphin(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("About Dolphin"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = ABOUTDOLPHIN_STYLE);
+ AboutDolphin(wxWindow *parent,
+ wxWindowID id = 1,
+ const wxString &title = wxT("About Dolphin"),
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_DIALOG_STYLE);
virtual ~AboutDolphin();
void CloseClick(wxCommandEvent& event);
diff --git a/Source/Core/DolphinWX/Src/CheatsWindow.cpp b/Source/Core/DolphinWX/Src/CheatsWindow.cpp
index 7edbb7c875..89033a70b8 100644
--- a/Source/Core/DolphinWX/Src/CheatsWindow.cpp
+++ b/Source/Core/DolphinWX/Src/CheatsWindow.cpp
@@ -20,6 +20,8 @@
#include "ActionReplay.h"
#include "Core.h"
+using namespace ActionReplay;
+
BEGIN_EVENT_TABLE(wxCheatsWindow, wxWindow)
EVT_SIZE( wxCheatsWindow::OnEvent_Window_Resize)
EVT_CLOSE( wxCheatsWindow::OnEvent_Window_Close)
@@ -31,7 +33,8 @@ BEGIN_EVENT_TABLE(wxCheatsWindow, wxWindow)
EVT_CHECKBOX(ID_CHECKBOX_LOGAR, wxCheatsWindow::OnEvent_CheckBoxEnableLogging_StateChange)
END_EVENT_TABLE()
-wxCheatsWindow::wxCheatsWindow(wxFrame* parent, const wxPoint& pos, const wxSize& size) : wxFrame(parent, wxID_ANY, _T("Action Replay"), pos, size, wxCHEATSWINDOW_STYLE)
+wxCheatsWindow::wxCheatsWindow(wxFrame* parent, const wxPoint& pos, const wxSize& size) :
+ wxFrame(parent, wxID_ANY, _T("Action Replay"), pos, size, wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
{
// Create the GUI controls
Init_ChildControls();
@@ -93,7 +96,7 @@ void wxCheatsWindow::Init_ChildControls()
m_Button_UpdateLog = new wxButton(m_Tab_Log, ID_BUTTON_UPDATELOG, wxT("Update"));
m_CheckBox_LogAR = new wxCheckBox(m_Tab_Log, ID_CHECKBOX_LOGAR, wxT("Enable AR Logging"));
- m_CheckBox_LogAR->SetValue(ActionReplay_IsSelfLogging());
+ m_CheckBox_LogAR->SetValue(IsSelfLogging());
m_TextCtrl_Log = new wxTextCtrl(m_Tab_Log, ID_TEXTCTRL_LOG, wxT(""), wxDefaultPosition, wxSize(100, 600), wxTE_MULTILINE | wxTE_READONLY | wxTE_DONTWRAP);
wxBoxSizer *HStrip1 = new wxBoxSizer(wxHORIZONTAL);
@@ -139,10 +142,10 @@ void wxCheatsWindow::OnEvent_Window_Close(wxCloseEvent& WXUNUSED (event))
void wxCheatsWindow::Load_ARCodes()
{
indexList.clear();
- size_t size = ActionReplay_GetCodeListSize();
+ size_t size = GetCodeListSize();
for (size_t i = 0; i < size; i++)
{
- ARCode code = ActionReplay_GetARCode(i);
+ ARCode code = GetARCode(i);
ARCodeIndex ind;
u32 index = m_CheckListBox_CheatsList->Append(wxString::FromAscii(code.name.c_str()));
m_CheckListBox_CheatsList->Check(index, code.active);
@@ -158,7 +161,7 @@ void wxCheatsWindow::OnEvent_CheatsList_ItemSelected(wxCommandEvent& WXUNUSED (e
{
if ((int)indexList[i].uiIndex == index)
{
- ARCode code = ActionReplay_GetARCode(i);
+ ARCode code = GetARCode(i);
m_Label_Codename->SetLabel(wxT("Name: ") + wxString::FromAscii(code.name.c_str()));
char text[CHAR_MAX];
char* numcodes = text;
@@ -183,7 +186,7 @@ void wxCheatsWindow::OnEvent_CheatsList_ItemToggled(wxCommandEvent& WXUNUSED (ev
{
if ((int)indexList[i].uiIndex == index)
{
- ActionReplay_SetARCode_IsActive(m_CheckListBox_CheatsList->IsChecked(index), indexList[i].index);
+ SetARCode_IsActive(m_CheckListBox_CheatsList->IsChecked(index), indexList[i].index);
}
}
}
@@ -191,14 +194,14 @@ void wxCheatsWindow::OnEvent_ButtonUpdateCodes_Press(wxCommandEvent& WXUNUSED (e
{
for (size_t i = 0; i < indexList.size(); i++)
{
- ActionReplay_SetARCode_IsActive(m_CheckListBox_CheatsList->IsChecked(indexList[i].uiIndex), indexList[i].index);
+ SetARCode_IsActive(m_CheckListBox_CheatsList->IsChecked(indexList[i].uiIndex), indexList[i].index);
}
}
void wxCheatsWindow::OnEvent_ButtonUpdateLog_Press(wxCommandEvent& WXUNUSED (event))
{
m_TextCtrl_Log->Clear();
- const std::vector &arLog = ActionReplay_GetSelfLog();
+ const std::vector &arLog = GetSelfLog();
for (u32 i = 0; i < arLog.size(); i++)
{
m_TextCtrl_Log->AppendText(wxString::FromAscii(arLog[i].c_str()));
@@ -207,5 +210,5 @@ void wxCheatsWindow::OnEvent_ButtonUpdateLog_Press(wxCommandEvent& WXUNUSED (eve
void wxCheatsWindow::OnEvent_CheckBoxEnableLogging_StateChange(wxCommandEvent& WXUNUSED (event))
{
- ActionReplay_EnableSelfLogging(m_CheckBox_LogAR->IsChecked());
+ EnableSelfLogging(m_CheckBox_LogAR->IsChecked());
}
diff --git a/Source/Core/DolphinWX/Src/CheatsWindow.h b/Source/Core/DolphinWX/Src/CheatsWindow.h
index 011d771f27..9f6016db9a 100644
--- a/Source/Core/DolphinWX/Src/CheatsWindow.h
+++ b/Source/Core/DolphinWX/Src/CheatsWindow.h
@@ -36,9 +36,6 @@
#include "Filesystem.h"
#include "IniFile.h"
-#undef wxCHEATSWINDOW_STYLE
-#define wxCHEATSWINDOW_STYLE wxCAPTION | wxSYSTEM_MENU | wxCLOSE_BOX | wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN | wxNO_FULL_REPAINT_ON_RESIZE
-
class wxCheatsWindow : public wxFrame
{
public:
diff --git a/Source/Core/DolphinWX/Src/ConfigMain.h b/Source/Core/DolphinWX/Src/ConfigMain.h
index f2db8af1d5..bcf8c69ce2 100644
--- a/Source/Core/DolphinWX/Src/ConfigMain.h
+++ b/Source/Core/DolphinWX/Src/ConfigMain.h
@@ -22,18 +22,19 @@
#include
#include
#include
-//#include
#include "Config.h"
-#undef CONFIG_MAIN_STYLE
-#define CONFIG_MAIN_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX
-
class CConfigMain
: public wxDialog
{
public:
- CConfigMain(wxWindow* parent, wxWindowID id = 1, const wxString& title = wxT("Dolphin Configuration"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = CONFIG_MAIN_STYLE);
+ CConfigMain(wxWindow* parent,
+ wxWindowID id = 1,
+ const wxString& title = wxT("Dolphin Configuration"),
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_DIALOG_STYLE);
virtual ~CConfigMain();
void CloseClick(wxCommandEvent& event);
void OnSelectionChanged(wxCommandEvent& event);
diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp
index abac431354..d3cb32cdf7 100644
--- a/Source/Core/DolphinWX/Src/ISOProperties.cpp
+++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp
@@ -22,20 +22,14 @@
#include "Filesystem.h"
#include "ISOProperties.h"
#include "PatchAddEdit.h"
+#include "ARCodeAddEdit.h"
DiscIO::IVolume *OpenISO = NULL;
DiscIO::IFileSystem *pFileSystem = NULL;
std::vector onFrame;
-
-struct ARListCode {
- std::string name;
- bool enabled;
- std::vector ops;
- u32 uiIndex;
-};
-std::vector ARCodes;
+std::vector arCodes;
BEGIN_EVENT_TABLE(CISOProperties, wxDialog)
@@ -698,86 +692,58 @@ void CISOProperties::PatchButtonClicked(wxCommandEvent& event)
void CISOProperties::ActionReplayList_Load()
{
- ARCodes.clear();
+ arCodes.clear();
Cheats->Clear();
- std::vector lines;
+ ActionReplay::LoadCodes(arCodes, GameIni);
- if (!GameIni.GetLines("ActionReplay", lines))
- return;
-
- ARListCode code;
-
- for (std::vector::const_iterator it = lines.begin(); it != lines.end(); ++it)
+ u32 index = 0;
+ for (std::vector::const_iterator it = arCodes.begin(); it != arCodes.end(); ++it)
{
- std::string line = *it;
-
- if (line[0] == '+' || line[0] == '$')
- {
- // Take care of the previous code
- if (code.ops.size())
- {
- code.uiIndex = Cheats->Append(wxString::FromAscii(code.name.c_str()));
- ARCodes.push_back(code);
- Cheats->Check(code.uiIndex, code.enabled);
- code.ops.clear();
- }
-
- // Give name and enabled to current code
- if(line.size() > 1)
- {
- if (line[0] == '+')
- {
- code.enabled = true;
- code.name = line.substr(2, line.size() - 2);
- }
- else
- {
- code.enabled = false;
- code.name = line.substr(1, line.size() - 1);
- }
- }
- continue;
- }
- code.ops.push_back(line);
- }
-
- if (code.ops.size())
- {
- code.uiIndex = Cheats->Append(wxString::FromAscii(code.name.c_str()));
- ARCodes.push_back(code);
- Cheats->Check(code.uiIndex, code.enabled);
+ ActionReplay::ARCode arCode = *it;
+ Cheats->Append(wxString::FromAscii(arCode.name.c_str()));
+ Cheats->Check(index, arCode.active);
+ ++index;
}
}
void CISOProperties::ActionReplayList_Save()
{
std::vector lines;
- for (std::vector::const_iterator iter = ARCodes.begin(); iter != ARCodes.end(); ++iter)
+ u32 index = 0;
+ for (std::vector::const_iterator iter = arCodes.begin(); iter != arCodes.end(); ++iter)
{
- ARListCode code = *iter;
+ ActionReplay::ARCode code = *iter;
- lines.push_back(Cheats->IsChecked(code.uiIndex) ? "+$" + code.name : "$" + code.name);
+ lines.push_back(Cheats->IsChecked(index) ? "+$" + code.name : "$" + code.name);
- for (std::vector::const_iterator iter2 = code.ops.begin(); iter2 != code.ops.end(); ++iter2)
+ for (std::vector::const_iterator iter2 = code.ops.begin(); iter2 != code.ops.end(); ++iter2)
{
- lines.push_back(*iter2);
+ lines.push_back(wxString::Format("%08X %08X", iter2->cmd_addr, iter2->value).mb_str());
}
+ ++index;
}
GameIni.SetLines("ActionReplay", lines);
}
void CISOProperties::ActionReplayButtonClicked(wxCommandEvent& event)
{
+ int selection = Cheats->GetSelection();
+
switch (event.GetId())
{
case ID_EDITCHEAT:
- // dialog
+ {
+ CARCodeAddEdit dlg(selection, this);
+ dlg.ShowModal();
+ }
break;
case ID_ADDCHEAT:
+ {
// dialog
+ }
break;
case ID_REMOVECHEAT:
- ARCodes.erase(ARCodes.begin() + Cheats->GetSelection());
+ arCodes.erase(arCodes.begin() + Cheats->GetSelection());
break;
}
diff --git a/Source/Core/DolphinWX/Src/ISOProperties.h b/Source/Core/DolphinWX/Src/ISOProperties.h
index ff499539c7..bce68b8e13 100644
--- a/Source/Core/DolphinWX/Src/ISOProperties.h
+++ b/Source/Core/DolphinWX/Src/ISOProperties.h
@@ -32,15 +32,19 @@
#include "Filesystem.h"
#include "IniFile.h"
#include "PatchEngine.h"
-
-#undef ISOPROPERTIES_STYLE
-#define ISOPROPERTIES_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX
+#include "ActionReplay.h"
class CISOProperties : public wxDialog
{
public:
- CISOProperties(const std::string fileName, wxWindow* parent, wxWindowID id = 1, const wxString& title = wxT("Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = ISOPROPERTIES_STYLE);
+ CISOProperties(const std::string fileName,
+ wxWindow* parent,
+ wxWindowID id = 1,
+ const wxString& title = wxT("Properties"),
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_DIALOG_STYLE);
virtual ~CISOProperties();
bool bRefreshList;
diff --git a/Source/Core/DolphinWX/Src/PatchAddEdit.h b/Source/Core/DolphinWX/Src/PatchAddEdit.h
index 6d4eb9c30b..3d4b92d8aa 100644
--- a/Source/Core/DolphinWX/Src/PatchAddEdit.h
+++ b/Source/Core/DolphinWX/Src/PatchAddEdit.h
@@ -25,7 +25,12 @@
class CPatchAddEdit : public wxDialog
{
public:
- CPatchAddEdit(int _selection, wxWindow* parent, wxWindowID id = 1, const wxString& title = wxT("Edit Patch"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(300, -1), long style = wxDEFAULT_DIALOG_STYLE);
+ CPatchAddEdit(int _selection, wxWindow* parent,
+ wxWindowID id = 1,
+ const wxString& title = wxT("Edit Patch"),
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxSize(300, -1),
+ long style = wxDEFAULT_DIALOG_STYLE);
virtual ~CPatchAddEdit();
private:
diff --git a/Source/Core/DolphinWX/Src/SConscript b/Source/Core/DolphinWX/Src/SConscript
index b54136e07f..c3bb079efb 100644
--- a/Source/Core/DolphinWX/Src/SConscript
+++ b/Source/Core/DolphinWX/Src/SConscript
@@ -18,6 +18,7 @@ libs = [
if wxenv['HAVE_WX']:
files += [
'AboutDolphin.cpp',
+ 'ARCodeAddEdit.cpp',
'ConfigMain.cpp',
'Frame.cpp',
'GameListCtrl.cpp',
@@ -27,10 +28,10 @@ if wxenv['HAVE_WX']:
'MemcardManager.cpp',
'MemoryCards/GCMemcard.cpp',
'PluginManager.cpp',
- 'PatchAddEdit.cpp',
+ 'PatchAddEdit.cpp',
'CheatsWindow.cpp',
'stdafx.cpp',
- 'FrameWiimote.cpp',
+ 'FrameWiimote.cpp',
]
CPPDEFINES = [
diff --git a/Source/PluginSpecs/pluginspecs_pad.h b/Source/PluginSpecs/pluginspecs_pad.h
index f28930c056..d6bca534e5 100644
--- a/Source/PluginSpecs/pluginspecs_pad.h
+++ b/Source/PluginSpecs/pluginspecs_pad.h
@@ -15,6 +15,7 @@
#define PAD_ERR_TRANSFER -3
#define PAD_USE_ORIGIN 0x0080
+
#define PAD_BUTTON_LEFT 0x0001
#define PAD_BUTTON_RIGHT 0x0002
#define PAD_BUTTON_DOWN 0x0004
@@ -32,13 +33,13 @@ typedef void (*TLog)(const char* _pMessage);
typedef struct
{
- HWND hWnd;
- TLog pLog;
+ HWND hWnd;
+ TLog pLog;
} SPADInitialize;
typedef struct
{
- unsigned short button; // Or-ed PAD_BUTTON_* bits
+ unsigned short button; // Or-ed PAD_BUTTON_* and PAD_TRIGGER_* bits
unsigned char stickX; // 0 <= stickX <= 255
unsigned char stickY; // 0 <= stickY <= 255
unsigned char substickX; // 0 <= substickX <= 255
@@ -47,7 +48,7 @@ typedef struct
unsigned char triggerRight; // 0 <= triggerRight <= 255
unsigned char analogA; // 0 <= analogA <= 255
unsigned char analogB; // 0 <= analogB <= 255
- bool MicButton;
+ bool MicButton; // HAX
signed char err; // one of PAD_ERR_* number
} SPADStatus;
@@ -59,7 +60,7 @@ typedef struct
// Function: GetDllInfo
// Purpose: This function allows the emulator to gather information
// about the DLL by filling in the PluginInfo structure.
-// input: a pointer to a PLUGIN_INFO structure that needs to be
+// input: A pointer to a PLUGIN_INFO structure that needs to be
// filled by the function. (see def above)
// output: none
//
@@ -69,7 +70,7 @@ EXPORT void CALL GetDllInfo(PLUGIN_INFO* _pPluginInfo);
// Function: DllConfig
// Purpose: This function is optional function that is provided
// to allow the user to configure the DLL
-// input: a handle to the window that calls this function
+// input: A handle to the window that calls this function
// output: none
//
EXPORT void CALL DllConfig(HWND _hParent);
diff --git a/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.h b/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.h
index fde1472614..4161d06e5f 100644
--- a/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.h
+++ b/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.h
@@ -32,9 +32,6 @@
#ifndef _WIN32
#include "../XInputBase.h"
#endif
-#undef CONFIGDIALOG_STYLE
-#define CONFIGDIALOG_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX
-
class ConfigDialog : public wxDialog
{
@@ -42,7 +39,7 @@ class ConfigDialog : public wxDialog
public:
ConfigDialog(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("Pad Configuration"),
- const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = CONFIGDIALOG_STYLE);
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE);
virtual ~ConfigDialog();
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.h b/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.h
index 6a18ff2d15..710c60e29f 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.h
+++ b/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.h
@@ -43,11 +43,6 @@
class CPBView;
class IniFile;
-// Window settings - I'm not sure what these do. I just copied them gtom elsewhere basically.
-#undef CDebugger_STYLE
-
-#define CDebugger_STYLE wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN | wxNO_FULL_REPAINT_ON_RESIZE
-
class CDebugger : public wxDialog
{
private:
@@ -56,7 +51,7 @@ class CDebugger : public wxDialog
public:
CDebugger(wxWindow *parent, wxWindowID id = 1, const wxString &title = _("Sound Debugger"),
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- long style = CDebugger_STYLE);
+ long style = wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN | wxNO_FULL_REPAINT_ON_RESIZE);
virtual ~CDebugger();
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h
index 8808182a4b..1a7f00aa96 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h
+++ b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h
@@ -15,8 +15,8 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
-#ifndef __CONFIGDIALOG_h__
-#define __CONFIGDIALOG_h__
+#ifndef __OGL_CONFIGDIALOG_h__
+#define __OGL_CONFIGDIALOG_h__
#include
#include
@@ -32,14 +32,11 @@
#include
-#undef ConfigDialog_STYLE
-#define ConfigDialog_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX
-
-
class ConfigDialog : public wxDialog
{
public:
- ConfigDialog(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("OpenGL Plugin Configuration"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = ConfigDialog_STYLE);
+ ConfigDialog(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("OpenGL Plugin Configuration"),
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE);
virtual ~ConfigDialog();
void CloseClick(wxCommandEvent& event);
diff --git a/Source/Plugins/Plugin_Wiimote/Src/ConfigDlg.h b/Source/Plugins/Plugin_Wiimote/Src/ConfigDlg.h
index f8f98345b1..4c34c4fe00 100644
--- a/Source/Plugins/Plugin_Wiimote/Src/ConfigDlg.h
+++ b/Source/Plugins/Plugin_Wiimote/Src/ConfigDlg.h
@@ -31,17 +31,13 @@
#include
-#undef ConfigDialog_STYLE
-#define ConfigDialog_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX
-
-
class ConfigDialog : public wxDialog
{
public:
ConfigDialog(wxWindow *parent, wxWindowID id = 1,
const wxString &title = wxT("Wii Remote Plugin Configuration"),
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- long style = ConfigDialog_STYLE);
+ long style = wxDEFAULT_DIALOG_STYLE);
virtual ~ConfigDialog();
void CloseClick(wxCommandEvent& event);
diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/AboutBox.h b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/AboutBox.h
index a9c57ab272..6da32df02a 100644
--- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/AboutBox.h
+++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/AboutBox.h
@@ -44,8 +44,6 @@
#include
#include
-#undef AboutBox_STYLE
-#define AboutBox_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX
class AboutBox : public wxDialog
{
@@ -53,7 +51,8 @@ class AboutBox : public wxDialog
DECLARE_EVENT_TABLE();
public:
- AboutBox(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("About: nJoy Input Plugin"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = AboutBox_STYLE);
+ AboutBox(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("About: nJoy Input Plugin"),
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE);
virtual ~AboutBox();
void OKClick(wxCommandEvent& event);
diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.h b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.h
index 4c450f16fc..0623fa9b10 100644
--- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.h
+++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.h
@@ -46,8 +46,6 @@
#include
#include
-#undef ConfigBox_STYLE
-#define ConfigBox_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX
class ConfigBox : public wxDialog
{
@@ -55,7 +53,8 @@ class ConfigBox : public wxDialog
DECLARE_EVENT_TABLE();
public:
- ConfigBox(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("Configure: nJoy Input Plugin"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = ConfigBox_STYLE);
+ ConfigBox(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("Configure: nJoy Input Plugin"),
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE);
virtual ~ConfigBox();
private:
diff --git a/Source/Plugins/Plugin_nJoy_Testing/Src/GUI/AboutBox.h b/Source/Plugins/Plugin_nJoy_Testing/Src/GUI/AboutBox.h
index a9c57ab272..6da32df02a 100644
--- a/Source/Plugins/Plugin_nJoy_Testing/Src/GUI/AboutBox.h
+++ b/Source/Plugins/Plugin_nJoy_Testing/Src/GUI/AboutBox.h
@@ -44,8 +44,6 @@
#include
#include
-#undef AboutBox_STYLE
-#define AboutBox_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX
class AboutBox : public wxDialog
{
@@ -53,7 +51,8 @@ class AboutBox : public wxDialog
DECLARE_EVENT_TABLE();
public:
- AboutBox(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("About: nJoy Input Plugin"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = AboutBox_STYLE);
+ AboutBox(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("About: nJoy Input Plugin"),
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE);
virtual ~AboutBox();
void OKClick(wxCommandEvent& event);
diff --git a/Source/Plugins/Plugin_nJoy_Testing/Src/GUI/ConfigBox.h b/Source/Plugins/Plugin_nJoy_Testing/Src/GUI/ConfigBox.h
index 2dd1872676..dffd9694ee 100644
--- a/Source/Plugins/Plugin_nJoy_Testing/Src/GUI/ConfigBox.h
+++ b/Source/Plugins/Plugin_nJoy_Testing/Src/GUI/ConfigBox.h
@@ -46,8 +46,6 @@
#include
#include
-#undef ConfigBox_STYLE
-#define ConfigBox_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX
class ConfigBox : public wxDialog
{
@@ -55,7 +53,8 @@ class ConfigBox : public wxDialog
DECLARE_EVENT_TABLE();
public:
- ConfigBox(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("Configure: nJoy Input Plugin"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = ConfigBox_STYLE);
+ ConfigBox(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("Configure: nJoy Input Plugin"),
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE);
virtual ~ConfigBox();
private: