Fixed many little DolphinWX annoyances/bugs. Added a little cheat sheet in EXI_DeviceMemoryCard.cpp so people can change the size of memcards, until (if) a feature is added to choose memcard size based on existing filesize.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@854 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2008-10-14 02:56:03 +00:00
parent b7e9a988f7
commit 5bb6f62d9f
13 changed files with 230 additions and 217 deletions

View File

@ -3,3 +3,51 @@ GFXPlugin = Plugins\Plugin_VideoOGL.dll
DSPPlugin = Plugins\Plugin_DSP_HLE.dll
PadPlugin = Plugins\Plugin_PadSimple.dll
WiiMotePlugin = Plugins\Plugin_Wiimote.dll
[General]
LastFilename = D:\Games\Gamecube\The Legend of Zelda - Wind Waker.gcz
GCMPathes = 1
GCMPath0 = D:\Games\Gamecube
GCMPath1 = C:\Users\Shawn\Desktop
[Core]
GFXPlugin = Plugins\Plugin_VideoOGL.dll
DSPPlugin = Plugins\Plugin_DSP_NULL.dll
PadPlugin = Plugins\Plugin_PadSimple.dll
WiiMotePlugin = Plugins\Plugin_Wiimote.dll
HLEBios = True
UseDynarec = True
UseDualCore = True
SkipIdle = True
LockThreads = False
DefaultGCM = D:\Games\Gamecube\The Legend of Zelda - Wind Waker.gcz
DVDRoot =
OptimizeQuantizers = True
SelectedLanguage = 0
RunCompareServer = False
RunCompareClient = False
[LogManager]
* = False
BOOT = False
PE = False
CP = False
VI = False
SI = False
PI = False
MI = False
DSP = False
Stream = False
DVD = False
GP = False
EXI = True
AI = False
GEKKO = False
HLE = False
DSPHLE = False
Video = False
Audio = False
DYNA = False
OSREPORT = False
CONSOLE = False
WII_IOB = False
WII_IPC = False
WII_IPC_HLE = False
WIIMOTE = False

View File

@ -14,7 +14,11 @@
#define _WX_RCDEFS_H
#define WX_MSC_FULL_VER 140050727
#define WX_MSC_FULL_VER 150030729
#define WX_CPU_AMD64
@ -30,10 +34,6 @@
#define WX_CPU_X86

View File

@ -54,12 +54,19 @@ CEXIMemoryCard::CEXIMemoryCard(const std::string& _rName, const std::string& _rF
memset(programming_buffer, 0, sizeof(programming_buffer));
formatDelay = 0;
nintendo_card_id = 0x00000010; // 16MBit nintendo card
//Nintendo Memory Card EXI IDs
//0x00000004 Memory Card 59 4Mbit
//0x00000008 Memory Card 123 8Mb
//0x00000010 Memory Card 251 16Mb
//0x00000020 Memory Card 507 32Mb
//0x00000040 Memory Card 1019 64Mb
//0x00000080 Memory Card 2043 128Mb
nintendo_card_id = 0x00000010;
card_id = 0xc221;
/* nintendo_card_id = 0x00000510; // 16MBit "bigben" card
card_id = 0xc243; */
//nintendo_card_id = 0x00000510; // 16Mb "bigben" card
//card_id = 0xc243;
memory_card_size = 2 * 1024 * 1024;
memory_card_size = 2 * 1024 * 1024; //16Mb
memory_card_content = new u8[memory_card_size];
memset(memory_card_content, 0xFF, memory_card_size);

View File

@ -59,6 +59,7 @@ bool BootCore(const std::string& _rFilename)
}
StartUp.m_BootType = SCoreStartupParameter::BOOT_ISO;
StartUp.m_strFilename = _rFilename;
SConfig::GetInstance().m_LastFilename = StartUp.m_strFilename;
StartUp.bRunCompareClient = false;
StartUp.bRunCompareServer = false;
StartUp.bEnableDebugging = g_pCodeWindow ? true : false; // RUNNING_DEBUG

View File

@ -38,6 +38,7 @@ EVT_CHECKBOX(ID_LOCKTHREADS, CConfigMain::LockThreadsCheck)
EVT_CHECKBOX(ID_OPTIMIZEQUANTIZERS, CConfigMain::OptimizeQuantizersCheck)
EVT_CHECKBOX(ID_IDLESKIP, CConfigMain::SkipIdleCheck)
EVT_CHOICE(ID_CONSOLELANG, CConfigMain::ConsoleLangChanged)
EVT_LISTBOX(ID_ISOPATHS, CConfigMain::ISOPathsSelectionChanged)
EVT_BUTTON(ID_ADDISOPATH, CConfigMain::AddRemoveISOPaths)
EVT_BUTTON(ID_REMOVEISOPATH, CConfigMain::AddRemoveISOPaths)
EVT_FILEPICKER_CHANGED(ID_DEFAULTISO, CConfigMain::DefaultISOChanged)
@ -56,6 +57,7 @@ END_EVENT_TABLE()
CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style)
: wxDialog(parent, id, title, position, size, style)
{
bRefreshList = false;
CreateGUIControls();
}
@ -139,6 +141,7 @@ void CConfigMain::CreateGUIControls()
ISOPaths = new wxListBox(PathsPage, ID_ISOPATHS, wxDefaultPosition, wxSize(290,150), arrayStringFor_ISOPaths, wxLB_SINGLE, wxDefaultValidator);
AddISOPath = new wxButton(PathsPage, ID_ADDISOPATH, wxT("Add..."), wxDefaultPosition, wxDefaultSize, 0);
RemoveISOPath = new wxButton(PathsPage, ID_REMOVEISOPATH, wxT("Remove"), wxDefaultPosition, wxDefaultSize, 0);
RemoveISOPath->Enable(false);
sISOButtons = new wxBoxSizer(wxHORIZONTAL);
sISOButtons->AddStretchSpacer(1);
@ -274,6 +277,18 @@ void CConfigMain::ConsoleLangChanged(wxCommandEvent& WXUNUSED (event))
SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage = ConsoleLang->GetSelection();
}
void CConfigMain::ISOPathsSelectionChanged(wxCommandEvent& WXUNUSED (event))
{
if (!ISOPaths->GetStringSelection().empty())
{
RemoveISOPath->Enable(true);
}
else
{
RemoveISOPath->Enable(false);
}
}
void CConfigMain::AddRemoveISOPaths(wxCommandEvent& event)
{
if (event.GetId() == ID_ADDISOPATH)
@ -285,22 +300,22 @@ void CConfigMain::AddRemoveISOPaths(wxCommandEvent& event)
if (dialog.ShowModal() == wxID_OK)
{
bRefreshList = true;
ISOPaths->Append(dialog.GetPath());
}
}
else
{
bRefreshList = true;
ISOPaths->Delete(ISOPaths->GetSelection());
}
//save changes right away
// Save changes right away
SConfig::GetInstance().m_ISOFolder.clear();
for (unsigned int i = 0; i < ISOPaths->GetCount(); i++)
{
SConfig::GetInstance().m_ISOFolder.push_back(std::string(ISOPaths->GetStrings()[i].ToAscii()));
}
}
void CConfigMain::DefaultISOChanged(wxFileDirPickerEvent& WXUNUSED (event))
{

View File

@ -37,6 +37,8 @@ class CConfigMain
void OnSelectionChanged(wxCommandEvent& event);
void OnConfig(wxCommandEvent& event);
bool bRefreshList;
private:
DECLARE_EVENT_TABLE();
@ -140,6 +142,7 @@ class CConfigMain
void OptimizeQuantizersCheck(wxCommandEvent& event);
void SkipIdleCheck(wxCommandEvent& event);
void ConsoleLangChanged(wxCommandEvent& event);
void ISOPathsSelectionChanged(wxCommandEvent& event);
void AddRemoveISOPaths(wxCommandEvent& event);
void DefaultISOChanged(wxFileDirPickerEvent& event);
void DVDRootChanged(wxFileDirPickerEvent& event);

View File

@ -27,11 +27,8 @@ BEGIN_EVENT_TABLE(CFilesystemViewer, wxDialog)
EVT_RIGHT_DOWN(CFilesystemViewer::OnRightClick)
EVT_TREE_ITEM_RIGHT_CLICK(ID_TREECTRL,CFilesystemViewer::OnRightClickOnTree)
EVT_BUTTON(ID_CLOSE,CFilesystemViewer::OnCloseClick)
EVT_BUTTON(ID_SAVEBNR,CFilesystemViewer::OnSaveBNRClick)
EVT_MENU(IDM_BNRSAVEAS, CFilesystemViewer::OnBannerImageSave)
EVT_MENU(IDM_EXTRACTFILE, CFilesystemViewer::OnExtractFile)
EVT_MENU(IDM_REPLACEFILE, CFilesystemViewer::OnReplaceFile)
EVT_MENU(IDM_RENAMEFILE, CFilesystemViewer::OnRenameFile)
END_EVENT_TABLE()
DiscIO::IVolume *OpenISO = NULL;
@ -50,7 +47,6 @@ CFilesystemViewer::CFilesystemViewer(const std::string fileName, wxWindow* paren
CreateGUIControls();
wxTreeItemId dirId = NULL;
fileIter beginning = Our_Files.begin(), end = Our_Files.end(),
pos = Our_Files.begin();
@ -60,7 +56,7 @@ CFilesystemViewer::CFilesystemViewer(const std::string fileName, wxWindow* paren
// Disk header and apploader
m_Name->SetValue(wxString(OpenISO->GetName().c_str(), wxConvUTF8));
m_Serial->SetValue(wxString(OpenISO->GetUniqueID().c_str(), wxConvUTF8));
m_GameID->SetValue(wxString(OpenISO->GetUniqueID().c_str(), wxConvUTF8));
switch (OpenISO->GetCountry())
{
case DiscIO::IVolume::COUNTRY_EUROPE:
@ -82,7 +78,7 @@ CFilesystemViewer::CFilesystemViewer(const std::string fileName, wxWindow* paren
temp = _T("0x") + wxString::FromAscii(OpenISO->GetMakerID().c_str());
m_MakerID->SetValue(temp);
m_Date->SetValue(wxString(OpenISO->GetApploaderDate().c_str(), wxConvUTF8));
m_TOC->SetValue(wxString::Format(_T("%u"), OpenISO->GetFSTSize()));
m_FST->SetValue(wxString::Format(_T("%u"), OpenISO->GetFSTSize()));
// Banner
// ...all the BannerLoader functions are bool...gross
@ -159,29 +155,29 @@ void CFilesystemViewer::CreateGUIControls()
sISODetails->AddGrowableCol(1);
m_NameText = new wxStaticText(this, ID_NAME_TEXT, wxT("Name:"), wxDefaultPosition, wxDefaultSize);
m_Name = new wxTextCtrl(this, ID_NAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_SerialText = new wxStaticText(this, ID_SERIAL_TEXT, wxT("Serial:"), wxDefaultPosition, wxDefaultSize);
m_Serial = new wxTextCtrl(this, ID_SERIAL, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_GameIDText = new wxStaticText(this, ID_GAMEID_TEXT, wxT("Game ID:"), wxDefaultPosition, wxDefaultSize);
m_GameID = new wxTextCtrl(this, ID_GAMEID, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_CountryText = new wxStaticText(this, ID_COUNTRY_TEXT, wxT("Country:"), wxDefaultPosition, wxDefaultSize);
m_Country = new wxTextCtrl(this, ID_COUNTRY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_MakerIDText = new wxStaticText(this, ID_MAKERID_TEXT, wxT("Maker ID:"), wxDefaultPosition, wxDefaultSize);
m_MakerID = new wxTextCtrl(this, ID_MAKERID, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_DateText = new wxStaticText(this, ID_DATE_TEXT, wxT("Date:"), wxDefaultPosition, wxDefaultSize);
m_Date = new wxTextCtrl(this, ID_DATE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_TOCText = new wxStaticText(this, ID_TOC_TEXT, wxT("TOC Size:"), wxDefaultPosition, wxDefaultSize);
m_TOC = new wxTextCtrl(this, ID_TOC, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_FSTText = new wxStaticText(this, ID_FST_TEXT, wxT("FST Size:"), wxDefaultPosition, wxDefaultSize);
m_FST = new wxTextCtrl(this, ID_FST, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
sISODetails->Add(m_NameText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sISODetails->Add(m_Name, wxGBPosition(0, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sISODetails->Add(m_SerialText, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sISODetails->Add(m_Serial, wxGBPosition(1, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sISODetails->Add(m_GameIDText, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sISODetails->Add(m_GameID, wxGBPosition(1, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sISODetails->Add(m_CountryText, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sISODetails->Add(m_Country, wxGBPosition(2, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sISODetails->Add(m_MakerIDText, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sISODetails->Add(m_MakerID, wxGBPosition(3, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sISODetails->Add(m_DateText, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sISODetails->Add(m_Date, wxGBPosition(4, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sISODetails->Add(m_TOCText, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sISODetails->Add(m_TOC, wxGBPosition(5, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sISODetails->Add(m_FSTText, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sISODetails->Add(m_FST, wxGBPosition(5, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sbISODetails->Add(sISODetails, 0, wxEXPAND, 5);
@ -194,18 +190,16 @@ void CFilesystemViewer::CreateGUIControls()
m_LangText = new wxStaticText(this, ID_LANG_TEXT, wxT("Show Language:"), wxDefaultPosition, wxDefaultSize);
m_Lang = new wxChoice(this, ID_LANG, wxDefaultPosition, wxDefaultSize, arrayStringFor_Lang, 0, wxDefaultValidator);
m_ShortText = new wxStaticText(this, ID_SHORTNAME_TEXT, wxT("Short Name:"), wxDefaultPosition, wxDefaultSize);
m_ShortName = new wxTextCtrl(this, ID_SHORTNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize);
m_ShortName = new wxTextCtrl(this, ID_SHORTNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_LongText = new wxStaticText(this, ID_LONGNAME_TEXT, wxT("Long Name:"), wxDefaultPosition, wxDefaultSize);
m_LongName = new wxTextCtrl(this, ID_LONGNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize);
m_LongName = new wxTextCtrl(this, ID_LONGNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_MakerText = new wxStaticText(this, ID_MAKER_TEXT, wxT("Maker:"), wxDefaultPosition, wxDefaultSize);
m_Maker = new wxTextCtrl(this, ID_MAKER, wxEmptyString, wxDefaultPosition, wxDefaultSize);
m_Maker = new wxTextCtrl(this, ID_MAKER, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_CommentText = new wxStaticText(this, ID_COMMENT_TEXT, wxT("Comment:"), wxDefaultPosition, wxDefaultSize);
m_Comment = new wxTextCtrl(this, ID_COMMENT, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
m_Comment = new wxTextCtrl(this, ID_COMMENT, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY);
m_BannerText = new wxStaticText(this, ID_BANNER_TEXT, wxT("Banner:"), wxDefaultPosition, wxDefaultSize);
// Needs to be image:
m_Banner = new wxTextCtrl(this, ID_BANNER, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
m_SaveBNR = new wxButton(this, ID_SAVEBNR, wxT("Save Changes to BNR"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_SaveBNR->Disable();
sBannerDetails->Add(m_VersionText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sBannerDetails->Add(m_Version, wxGBPosition(0, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
@ -221,7 +215,6 @@ void CFilesystemViewer::CreateGUIControls()
sBannerDetails->Add(m_Comment, wxGBPosition(4, 1), wxGBSpan(1, 3), wxEXPAND|wxALL, 5);
sBannerDetails->Add(m_BannerText, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALL, 5);
sBannerDetails->Add(m_Banner, wxGBPosition(5, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sBannerDetails->Add(m_SaveBNR, wxGBPosition(5, 2), wxGBSpan(1, 2), wxEXPAND|wxALL, 5);
sbBannerDetails->Add(sBannerDetails, 0, wxEXPAND, 0);
@ -257,7 +250,7 @@ void CFilesystemViewer::OnCloseClick(wxCommandEvent& WXUNUSED (event))
void CFilesystemViewer::OnRightClick(wxMouseEvent& WXUNUSED (event))
{
//check for right click on banner image
//if(event.GetId() == ID_SAVEBNR)
//if(event.GetId() == ID_BANNER)
//{
// //on banner then save as.
// wxMenu popupMenu;
@ -272,19 +265,15 @@ void CFilesystemViewer::OnRightClickOnTree(wxTreeEvent& event)
m_Treectrl->SelectItem(event.GetItem());
wxMenu popupMenu;
if (m_Treectrl->ItemHasChildren(m_Treectrl->GetSelection()))
;//popupMenu.Append(IDM_EXTRACTFILE, wxString::FromAscii("Extract Directory..."));
else
popupMenu.Append(IDM_EXTRACTFILE, wxString::FromAscii("Extract File..."));
popupMenu.Append(IDM_REPLACEFILE, wxString::FromAscii("Replace File..."));
popupMenu.Append(IDM_RENAMEFILE, wxString::FromAscii("Rename File..."));
PopupMenu(&popupMenu);
event.Skip();
}
void CFilesystemViewer::OnSaveBNRClick(wxCommandEvent& WXUNUSED (event))
{
}
void CFilesystemViewer::OnBannerImageSave(wxCommandEvent& WXUNUSED (event))
{
@ -322,13 +311,3 @@ void CFilesystemViewer::OnExtractFile(wxCommandEvent& WXUNUSED (event))
pFileSystem->ExportFile(File.mb_str(), Path.mb_str());
}
void CFilesystemViewer::OnReplaceFile(wxCommandEvent& WXUNUSED (event))
{
wxMessageBox(_T("Not implemented yet."), _T("Sorry"), wxOK, this);
}
void CFilesystemViewer::OnRenameFile(wxCommandEvent& WXUNUSED (event))
{
wxMessageBox(_T("Not implemented yet."), _T("Sorry"), wxOK, this);
}

View File

@ -52,11 +52,11 @@ class CFilesystemViewer : public wxDialog
wxButton *m_Close;
wxStaticText *m_NameText;
wxStaticText *m_SerialText;
wxStaticText *m_GameIDText;
wxStaticText *m_CountryText;
wxStaticText *m_MakerIDText;
wxStaticText *m_DateText;
wxStaticText *m_TOCText;
wxStaticText *m_FSTText;
wxStaticText *m_VersionText;
wxStaticText *m_LangText;
wxStaticText *m_ShortText;
@ -66,11 +66,11 @@ class CFilesystemViewer : public wxDialog
wxStaticText *m_BannerText;
wxTextCtrl *m_Name;
wxTextCtrl *m_Serial;
wxTextCtrl *m_GameID;
wxTextCtrl *m_Country;
wxTextCtrl *m_MakerID;
wxTextCtrl *m_Date;
wxTextCtrl *m_TOC;
wxTextCtrl *m_FST;
wxTextCtrl *m_Version;
wxTextCtrl *m_ShortName;
wxTextCtrl *m_LongName;
@ -88,11 +88,11 @@ class CFilesystemViewer : public wxDialog
ID_TREECTRL,
ID_NAME_TEXT,
ID_SERIAL_TEXT,
ID_GAMEID_TEXT,
ID_COUNTRY_TEXT,
ID_MAKERID_TEXT,
ID_DATE_TEXT,
ID_TOC_TEXT,
ID_FST_TEXT,
ID_VERSION_TEXT,
ID_LANG_TEXT,
ID_SHORTNAME_TEXT,
@ -102,11 +102,11 @@ class CFilesystemViewer : public wxDialog
ID_BANNER_TEXT,
ID_NAME,
ID_SERIAL,
ID_GAMEID,
ID_COUNTRY,
ID_MAKERID,
ID_DATE,
ID_TOC,
ID_FST,
ID_VERSION,
ID_LANG,
ID_SHORTNAME,

View File

@ -148,22 +148,17 @@ CFrame::CFrame(wxFrame* parent,
m_pStatusBar = CreateStatusBar();
CreateMenu();
// this panel is the parent for rendering and it holds the gamelistctrl
{
// This panel is the parent for rendering and it holds the gamelistctrl
m_Panel = new wxPanel(this);
m_GameListCtrl = new CGameListCtrl(m_Panel, LIST_CTRL,
wxDefaultPosition, wxDefaultSize,
wxLC_REPORT | wxSUNKEN_BORDER | wxLC_ALIGN_LEFT);
wxBoxSizer* sizerPanel = new wxBoxSizer(wxHORIZONTAL);
sizerPanel->Add(m_GameListCtrl, 2, wxEXPAND | wxALL);
sizerPanel = new wxBoxSizer(wxHORIZONTAL);
sizerPanel->Add(m_GameListCtrl, 2, wxEXPAND);
m_Panel->SetSizer(sizerPanel);
sizerPanel->SetSizeHints(m_Panel);
sizerPanel->Fit(m_Panel);
}
// Create the toolbar
RecreateToolbar();
@ -173,6 +168,8 @@ CFrame::CFrame(wxFrame* parent,
m_GameListCtrl->Update();
sizerPanel->SetSizeHints(m_Panel);
wxTheApp->Connect(wxID_ANY, wxEVT_KEY_DOWN,
wxKeyEventHandler(CFrame::OnKeyDown),
(wxObject*)0, this);
@ -421,28 +418,14 @@ void CFrame::OnPlay(wxCommandEvent& WXUNUSED (event))
UpdateGUI();
}
else if (!SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM.empty())
else if (m_GameListCtrl->GetSelectedISO() != 0)
{
if (wxFileExists(wxString(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM.c_str(), wxConvUTF8)))
{
BootManager::BootCore(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM);
BootManager::BootCore(m_GameListCtrl->GetSelectedISO()->GetFileName());
}
else
else if (!SConfig::GetInstance().m_LastFilename.empty() &&
wxFileExists(wxString(SConfig::GetInstance().m_LastFilename.c_str(), wxConvUTF8)))
{
wxMessageBox(_("The default ISO you have set is invalid.\n"
"Please pick on new one by right clicking on a game\n"
"and selecting \"Set as default ISO\"."),
_("Invalid Default ISO"),
wxOK, this);
}
}
else
{
wxMessageBox(_("You can set an ISO to load by default.\n"
"Choose one by right clicking on a game and selecting\n"
"\"Set as default ISO\"."),
_("Set Default ISO"),
wxOK, this);
BootManager::BootCore(SConfig::GetInstance().m_LastFilename);
}
}
@ -470,6 +453,8 @@ void CFrame::OnConfigMain(wxCommandEvent& WXUNUSED (event))
{
CConfigMain ConfigMain(this);
ConfigMain.ShowModal();
if (ConfigMain.bRefreshList)
m_GameListCtrl->Update();
}
@ -692,6 +677,7 @@ void CFrame::UpdateGUI()
{
if (m_GameListCtrl && !m_GameListCtrl->IsShown())
{
sizerPanel->Fit(m_Panel);
m_GameListCtrl->Enable();
m_GameListCtrl->Show();
}

View File

@ -19,6 +19,7 @@ class CFrame
private:
wxBoxSizer* sizerPanel;
CGameListCtrl* m_GameListCtrl;
wxPanel* m_Panel;

View File

@ -61,10 +61,8 @@ BEGIN_EVENT_TABLE(CGameListCtrl, wxListCtrl)
EVT_SIZE(CGameListCtrl::OnSize)
EVT_RIGHT_DOWN(CGameListCtrl::OnRightClick)
EVT_LIST_COL_BEGIN_DRAG(LIST_CTRL, CGameListCtrl::OnColBeginDrag)
EVT_LIST_ITEM_SELECTED(LIST_CTRL, CGameListCtrl::OnSelected)
EVT_LIST_ITEM_ACTIVATED(LIST_CTRL, CGameListCtrl::OnActivated)
EVT_LIST_COL_CLICK(LIST_CTRL, CGameListCtrl::OnColumnClick)
EVT_LIST_COL_END_DRAG(LIST_CTRL, CGameListCtrl::OnColEndDrag)
EVT_MENU(IDM_EDITPATCHFILE, CGameListCtrl::OnEditPatchFile)
EVT_MENU(IDM_OPENCONTAININGFOLDER, CGameListCtrl::OnOpenContainingFolder)
EVT_MENU(IDM_SETDEFAULTGCM, CGameListCtrl::OnSetDefaultGCM)
@ -78,12 +76,11 @@ END_EVENT_TABLE()
CGameListCtrl::CGameListCtrl(wxWindow* parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
: wxListCtrl(parent, id, pos, size, style) // | wxLC_VIRTUAL)
{
InitBitmaps();
}
CGameListCtrl::~CGameListCtrl()
{
delete m_imageListSmall;
if (m_imageListSmall) delete m_imageListSmall;
}
void CGameListCtrl::InitBitmaps()
@ -124,6 +121,12 @@ void CGameListCtrl::BrowseForDirectory()
void CGameListCtrl::Update()
{
if (m_imageListSmall)
{
delete m_imageListSmall;
m_imageListSmall = NULL;
}
Hide();
ScanForISOs();
@ -132,6 +135,9 @@ void CGameListCtrl::Update()
if (m_ISOFiles.size() != 0)
{
// Don't load bitmaps unless there are games to list
InitBitmaps();
// add columns
InsertColumn(COLUMN_BANNER, _("Banner"));
InsertColumn(COLUMN_TITLE, _("Title"));
@ -153,6 +159,8 @@ void CGameListCtrl::Update()
for (int i = 0; i < (int)m_ISOFiles.size(); i++)
{
InsertItemInReportView(i);
if (m_ISOFiles[i].IsCompressed())
SetItemTextColour(i, wxColour(0xFF0000));
}
SetColumnWidth(COLUMN_SIZE, wxLIST_AUTOSIZE);
@ -161,11 +169,10 @@ void CGameListCtrl::Update()
{
InsertColumn(COLUMN_BANNER, _("No ISOs found"));
// data
wxString buf(_("Dolphin could not find any GC/Wii ISOs. Doubleclick here to browse for files..."));
long item = InsertItem(0, buf, -1);
SetItemFont(item, *wxITALIC_FONT);
SetColumnWidth(item, wxLIST_AUTOSIZE);
long index = InsertItem(0, wxString::FromAscii("msgRow"));
SetItem(index, COLUMN_BANNER, _("Dolphin could not find any GC/Wii ISOs. Doubleclick here to browse for files..."));
SetItemFont(index, *wxITALIC_FONT);
SetColumnWidth(COLUMN_BANNER, wxLIST_AUTOSIZE);
}
AutomaticColumnWidth();
@ -206,62 +213,26 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
ImageIndex = m_imageListSmall->Add(rISOFile.GetImage());
}
// data
wxString buf;
long ItemIndex = InsertItem(_Index, buf, ImageIndex);
// Insert a row with the banner image
long ItemIndex = InsertItem(_Index, wxEmptyString, ImageIndex);
// background color
SetBackgroundColor(); //temp fix so we can colorize background after sorting
/*{
wxListItem item;
item.SetId(ItemIndex);
item.SetBackgroundColour(color);
SetItem(item);
}*/
// Background color
SetBackgroundColor();
// title
// When using wxListCtrl, there is no hope of per-column text colors.
// But for reference, here are the old colors that were used: (BGR)
// title: 0xFF0000
// company: 0x007030
SetItem(_Index, COLUMN_TITLE, wxString::FromAscii(rISOFile.GetName().c_str()), -1);
SetItem(_Index, COLUMN_COMPANY, wxString::FromAscii(rISOFile.GetCompany().c_str()), -1);
SetItem(_Index, COLUMN_NOTES, wxString::FromAscii(rISOFile.GetDescription().c_str()), -1);
SetItem(_Index, COLUMN_SIZE, NiceSizeFormat(rISOFile.GetFileSize()), -1);
// Emulation status = COLUMN_EMULATION_STATE
{
wxListItem item;
item.SetId(ItemIndex);
item.SetColumn(COLUMN_TITLE);
//SetItemTextColour(item, (wxColour(0xFF0000)));
item.SetText(wxString::FromAscii(rISOFile.GetName().c_str()));
SetItem(item);
}
// company
{
wxListItem item;
item.SetId(ItemIndex);
item.SetColumn(COLUMN_COMPANY);
//SetItemTextColour(item, (wxColour(0x007030)));
item.SetText(wxString::FromAscii(rISOFile.GetCompany().c_str()));
SetItem(item);
}
// description
{
wxListItem item;
item.SetId(ItemIndex);
item.SetColumn(COLUMN_NOTES);
item.SetText(wxString::FromAscii(rISOFile.GetDescription().c_str()));
SetItem(item);
}
// size
{
wxListItem item;
item.SetId(ItemIndex);
item.SetColumn(COLUMN_SIZE);
item.SetText(NiceSizeFormat(rISOFile.GetFileSize()));
if (rISOFile.IsCompressed())
item.SetTextColour(wxColour(0xFF0000));
SetItem(item);
}
//emulation status = COLUMN_EMULATION_STATE
{
wxListItem item;
item.SetId(ItemIndex);
item.SetId(_Index);
IniFile ini;
std::string EmuState;
std::string GameIni;
@ -271,13 +242,7 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
GameIni = "GameIni/" + (rISOFile.GetUniqueID()) + ".ini";
ini.Load(GameIni.c_str());
ini.Get("EmuState","EmulationStateId",&EmuState);
if (EmuState.empty())
{
//srry, its empty
//item.SetText(_("unknown"));
//without unknown it looks more pretty :P
}
else
if (!EmuState.empty())
{
if(EmuState == "5")
item.SetText(_("Perfect"));
@ -304,11 +269,10 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
}
}
SetItem(item);
}
#ifndef __WXMSW__
// country
// Country
{
// Can't do this in Windows - we use DrawSubItem instead, see below
wxListItem item;
@ -326,8 +290,8 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
}
#endif // __WXMSW__
// item data
SetItemData(ItemIndex, _Index);
// Item data
SetItemData(_Index, ItemIndex);
}
bool CGameListCtrl::MSWDrawSubItem(wxPaintDC& rPaintDC, int item, int subitem)
@ -337,7 +301,6 @@ bool CGameListCtrl::MSWDrawSubItem(wxPaintDC& rPaintDC, int item, int subitem)
switch (subitem)
{
case COLUMN_COUNTRY:
{
size_t Index = GetItemData(item);
if (Index < m_ISOFiles.size())
@ -348,7 +311,6 @@ bool CGameListCtrl::MSWDrawSubItem(wxPaintDC& rPaintDC, int item, int subitem)
m_imageListSmall->Draw(m_FlagImageIndex[rISO.GetCountry()], rPaintDC, SubItemRect.GetLeft(), SubItemRect.GetTop());
}
}
}
#endif
return(Result);
@ -501,10 +463,6 @@ void CGameListCtrl::OnColumnClick(wxListEvent& event)
event.Skip();
}
void CGameListCtrl::OnColEndDrag(wxListEvent& WXUNUSED (event))
{
}
void CGameListCtrl::OnRightClick(wxMouseEvent& event)
{
// Focus the clicked item.
@ -549,6 +507,8 @@ void CGameListCtrl::OnRightClick(wxMouseEvent& event)
else if (GetSelectedItemCount() > 1)
{
wxMenu popupMenu;
popupMenu.Append(IDM_DELETEGCM, wxString::FromAscii("&Delete selected ISOs..."));
popupMenu.AppendSeparator();
popupMenu.Append(IDM_MULTICOMPRESSGCM, wxString::FromAscii("Compress selected ISOs..."));
popupMenu.Append(IDM_MULTIDECOMPRESSGCM, wxString::FromAscii("Decompress selected ISOs..."));
PopupMenu(&popupMenu);
@ -572,14 +532,19 @@ void CGameListCtrl::OnActivated(wxListEvent& event)
}
}
const GameListItem * CGameListCtrl::GetSelectedISO() const
const GameListItem * CGameListCtrl::GetSelectedISO()
{
int item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
long item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (item == -1)
return 0;
else
{
if (GetSelectedItemCount() > 1)
SetItemState(item, 0, wxLIST_STATE_SELECTED);
return &m_ISOFiles[GetItemData(item)];
}
}
void CGameListCtrl::OnOpenContainingFolder(wxCommandEvent& WXUNUSED (event))
{
@ -601,16 +566,35 @@ void CGameListCtrl::OnSetDefaultGCM(wxCommandEvent& WXUNUSED (event))
}
void CGameListCtrl::OnDeleteGCM(wxCommandEvent& WXUNUSED (event))
{
if (GetSelectedItemCount() == 1)
{
const GameListItem *iso = GetSelectedISO();
if (!iso)
return;
if (wxMessageBox(_T("Are you sure you want to delete this file?"), wxMessageBoxCaptionStr, wxYES_NO) == wxYES)
if (wxMessageBox(_T("Are you sure you want to delete this file?"),
wxMessageBoxCaptionStr, wxYES_NO|wxICON_EXCLAMATION) == wxYES)
{
File::Delete(iso->GetFileName().c_str());
Update();
}
}
else
{
if (wxMessageBox(_T("Are you sure you want to delete these files?\nThey will be gone forever!"),
wxMessageBoxCaptionStr, wxYES_NO|wxICON_EXCLAMATION) == wxYES)
{
int selected = GetSelectedItemCount();
for (int i = 0; i < selected; i++)
{
const GameListItem *iso = GetSelectedISO();
File::Delete(iso->GetFileName().c_str());
}
Update();
}
}
}
void CGameListCtrl::OnFilesystemViewer(wxCommandEvent& WXUNUSED (event))
{
@ -666,39 +650,36 @@ void CGameListCtrl::CompressSelection(bool _compress)
m_currentItem = 0;
m_numberItem = GetSelectedItemCount();
for (int i=0; i<GetItemCount(); i++)
for (int i=0; i<m_numberItem; i++)
{
const GameListItem& rISOFile = m_ISOFiles[i];
if (GetItemState(i, wxLIST_STATE_SELECTED) == wxLIST_STATE_SELECTED)
{
if (!rISOFile.IsCompressed() && _compress)
const GameListItem *iso = GetSelectedISO();
if (!iso->IsCompressed() && _compress)
{
std::string FileName;
SplitPath(rISOFile.GetFileName(), NULL, &FileName, NULL);
SplitPath(iso->GetFileName(), NULL, &FileName, NULL);
m_currentFilename = FileName;
FileName.append(".gcz");
std::string OutputFileName;
BuildCompleteFilename(OutputFileName, (const char *)browseDialog.GetPath().mb_str(wxConvUTF8), FileName);
DiscIO::CompressFileToBlob(rISOFile.GetFileName().c_str(), OutputFileName.c_str(), 0, 16384, &MultiCompressCB, &progressDialog);
DiscIO::CompressFileToBlob(iso->GetFileName().c_str(), OutputFileName.c_str(), 0, 16384, &MultiCompressCB, &progressDialog);
}
else if (rISOFile.IsCompressed() && !_compress)
else if (iso->IsCompressed() && !_compress)
{
std::string FileName;
SplitPath(rISOFile.GetFileName(), NULL, &FileName, NULL);
SplitPath(iso->GetFileName(), NULL, &FileName, NULL);
m_currentFilename = FileName;
FileName.append(".gcm");
std::string OutputFileName;
BuildCompleteFilename(OutputFileName, (const char *)browseDialog.GetPath().mb_str(wxConvUTF8), FileName);
DiscIO::DecompressBlobToFile(rISOFile.GetFileName().c_str(), OutputFileName.c_str(), &MultiCompressCB, &progressDialog);
DiscIO::DecompressBlobToFile(iso->GetFileName().c_str(), OutputFileName.c_str(), &MultiCompressCB, &progressDialog);
}
m_currentItem++;
}
}
Update();
}
@ -808,11 +789,6 @@ void CGameListCtrl::OnEditPatchFile(wxCommandEvent& WXUNUSED (event))
File::Launch(filename.c_str());
}
void CGameListCtrl::OnSelected(wxListEvent& WXUNUSED (event))
{
}
void CGameListCtrl::OnSize(wxSizeEvent& event)
{
AutomaticColumnWidth();
@ -838,7 +814,6 @@ void CGameListCtrl::AutomaticColumnWidth()
}
}
void CGameListCtrl::UnselectAll()
{
for (int i=0; i<GetItemCount(); i++)

View File

@ -33,7 +33,7 @@ public:
void Update();
void BrowseForDirectory();
const GameListItem *GetSelectedISO() const;
const GameListItem *GetSelectedISO();
const GameListItem *GetISO(int index) const;
enum
@ -67,8 +67,6 @@ private:
void OnRightClick(wxMouseEvent& event);
void OnColumnClick(wxListEvent& event);
void OnColBeginDrag(wxListEvent& event);
void OnColEndDrag(wxListEvent& event);
void OnSelected(wxListEvent& event);
void OnActivated(wxListEvent& event);
void OnSize(wxSizeEvent& event);
void OnEditPatchFile(wxCommandEvent& event);