continue changing src to Src

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@474 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee
2008-09-07 20:29:31 +00:00
parent 21171d8b1b
commit ac83588c3a
34 changed files with 3 additions and 4999 deletions
+1 -1
View File
@@ -23,7 +23,7 @@
#include <wx/mstream.h>
// ugly that this lib included code from the main
#include "../../DolphinWX/src/Globals.h"
#include "../../DolphinWX/Src/Globals.h"
#include "IniFile.h"
#include "Host.h"
+1 -1
View File
@@ -40,7 +40,7 @@
#include "LogManager.h"
// ugly that this lib included code from the main
#include "../../DolphinWX/src/Globals.h"
#include "../../DolphinWX/Src/Globals.h"
// UGLY
namespace {
+1 -1
View File
@@ -36,7 +36,7 @@
#include "LogManager.h"
// ugly that this lib included code from the main
#include "../../DolphinWX/src/Globals.h"
#include "../../DolphinWX/Src/Globals.h"
enum
-106
View File
@@ -1,106 +0,0 @@
// 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 <string>
#include <vector>
#include "Globals.h"
#include "Common.h"
#include "IniFile.h"
#include "BootManager.h"
#include "ISOFile.h"
#include "Volume.h"
#include "VolumeCreator.h"
#include "Config.h"
#include "Core.h"
#include "Frame.h"
#include "CodeWindow.h"
static std::string s_DataBasePath_EUR = "Data_EUR";
static std::string s_DataBasePath_USA = "Data_USA";
static std::string s_DataBasePath_JAP = "Data_JAP";
extern CFrame* main_frame;
extern CCodeWindow* g_pCodeWindow;
namespace BootManager
{
#ifdef _WIN32
extern "C" HINSTANCE wxGetInstance();
#endif
bool BootCore(const std::string& _rFilename)
{
SCoreStartupParameter StartUp = SConfig::GetInstance().m_LocalCoreStartupParameter;
if (g_pCodeWindow)
{
// StartUp.bUseDualCore = code_frame->UseDualCore();
StartUp.bUseJIT = !g_pCodeWindow->UseInterpreter();
}
else
{
// StartUp.bUseDualCore = false;
StartUp.bUseJIT = true;
}
StartUp.m_BootType = SCoreStartupParameter::BOOT_ISO;
StartUp.m_strFilename = _rFilename;
StartUp.bRunCompareClient = false;
StartUp.bRunCompareServer = false;
StartUp.bEnableDebugging = g_pCodeWindow ? true : false; // RUNNING_DEBUG
std::string BaseDataPath;
#ifdef _WIN32
StartUp.hInstance = wxGetInstance();
#ifdef _M_X64
StartUp.bUseFastMem = true;
#endif
#endif
if ( !StartUp.AutoSetup(SCoreStartupParameter::BOOT_DEFAULT) )
{
return false;
}
// Load overrides
IniFile ini;
std::string unique_id = StartUp.GetUniqueID();
if (unique_id.size() == 6 && ini.Load(("Patches/" + unique_id + ".ini").c_str()))
{
ini.Get("Core", "UseDualCore", &StartUp.bUseDualCore, StartUp.bUseDualCore);
ini.Get("Core", "OptimizeQuantizers", &StartUp.bOptimizeQuantizers, StartUp.bOptimizeQuantizers);
}
if(main_frame)
StartUp.hMainWindow = main_frame->GetRenderHandle();
// init the core
if (!Core::Init(StartUp))
{
PanicAlert("Couldn't init the core.\nCheck your configuration.");
return(false);
}
Core::SetState(g_pCodeWindow ? Core::CORE_PAUSE : Core::CORE_RUN);
return(true);
}
void Stop()
{
Core::Stop();
}
} // namespace
-32
View File
@@ -1,32 +0,0 @@
// 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 _BOOTMANAGER_H
#define _BOOTMANAGER_H
#include <string>
class CISOFile;
namespace BootManager
{
bool BootCore(const std::string& _rFilename);
void Stop();
};
#endif
-122
View File
@@ -1,122 +0,0 @@
// 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 <string>
#include "Globals.h"
#include "Common.h"
#include "IniFile.h"
#include "Config.h"
SConfig SConfig::m_Instance;
SConfig::SConfig()
{
LoadSettings();
}
SConfig::~SConfig()
{
SaveSettings();
}
void SConfig::SaveSettings()
{
IniFile ini;
ini.Load("Dolphin.ini"); // yes we must load first to not kill unknown stuff
// misc
{
ini.Set("General", "LastFilename", m_LastFilename);
// ISO folders
ini.Set("General", "GCMPathes", (int)m_ISOFolder.size());
for (size_t i = 0; i < m_ISOFolder.size(); i++)
{
TCHAR tmp[16];
sprintf(tmp, "GCMPath%i", (int)i);
ini.Set("General", tmp, m_ISOFolder[i]);
}
}
// core
{
ini.Set("Core", "GFXPlugin", m_LocalCoreStartupParameter.m_strVideoPlugin);
ini.Set("Core", "DSPPlugin", m_LocalCoreStartupParameter.m_strDSPPlugin);
ini.Set("Core", "PadPlugin", m_LocalCoreStartupParameter.m_strPadPlugin);
ini.Set("Core", "HLEBios", m_LocalCoreStartupParameter.bHLEBios);
ini.Set("Core", "UseDynarec", m_LocalCoreStartupParameter.bUseJIT);
ini.Set("Core", "UseDualCore", m_LocalCoreStartupParameter.bUseDualCore);
ini.Set("Core", "LockThreads", m_LocalCoreStartupParameter.bLockThreads);
ini.Set("Core", "DefaultGCM", m_LocalCoreStartupParameter.m_strDefaultGCM);
ini.Set("Core", "OptimizeQuantizers", m_LocalCoreStartupParameter.bOptimizeQuantizers);
}
ini.Save("Dolphin.ini");
}
void SConfig::LoadSettings()
{
IniFile ini;
ini.Load("Dolphin.ini");
// hard coded default plugin
{
ini.Get("Default", "GFXPlugin", &m_DefaultGFXPlugin);
ini.Get("Default", "DSPPlugin", &m_DefaultDSPPlugin);
ini.Get("Default", "PadPlugin", &m_DefaultPADPlugin);
}
// misc
{
ini.Get("General", "LastFilename", &m_LastFilename);
m_ISOFolder.clear();
int numGCMPaths;
if (ini.Get("General", "GCMPathes", &numGCMPaths, 0))
{
for (int i = 0; i < numGCMPaths; i++)
{
TCHAR tmp[16];
sprintf(tmp, "GCMPath%i", i);
std::string tmpPath;
ini.Get("General", tmp, &tmpPath, "");
m_ISOFolder.push_back(tmpPath);
}
}
}
// core
{
ini.Get("Core", "GFXPlugin", &m_LocalCoreStartupParameter.m_strVideoPlugin, m_DefaultGFXPlugin.c_str());
ini.Get("Core", "DSPPlugin", &m_LocalCoreStartupParameter.m_strDSPPlugin, m_DefaultDSPPlugin.c_str());
ini.Get("Core", "PadPlugin", &m_LocalCoreStartupParameter.m_strPadPlugin, m_DefaultPADPlugin.c_str());
ini.Get("Core", "HLEBios", &m_LocalCoreStartupParameter.bHLEBios, true);
ini.Get("Core", "UseDynarec", &m_LocalCoreStartupParameter.bUseJIT, true);
ini.Get("Core", "UseDualCore", &m_LocalCoreStartupParameter.bUseDualCore, false);
ini.Get("Core", "LockThreads", &m_LocalCoreStartupParameter.bLockThreads, true);
ini.Get("Core", "OptimizeQuantizers", &m_LocalCoreStartupParameter.bOptimizeQuantizers, true);
}
}
-63
View File
@@ -1,63 +0,0 @@
// 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 _CONFIG_H
#define _CONFIG_H
#include <string>
#include <vector>
#include "Boot/Boot.h"
struct SConfig
{
// default plugins ... hard coded inside the ini
std::string m_DefaultGFXPlugin;
std::string m_DefaultDSPPlugin;
std::string m_DefaultPADPlugin;
// name of the last used filename
std::string m_LastFilename;
// gcm folder
std::vector<std::string>m_ISOFolder;
SCoreStartupParameter m_LocalCoreStartupParameter;
// save settings
void SaveSettings();
// load settings
void LoadSettings();
static SConfig& GetInstance() {return(m_Instance);}
private:
// constructor
SConfig();
// destructor
~SConfig();
static SConfig m_Instance;
};
#endif
-115
View File
@@ -1,115 +0,0 @@
// 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 "Globals.h"
#ifndef _WIN32
#include <sys/types.h>
#include <dirent.h>
#else
#include <windows.h>
#endif
#include <string>
#include "FileSearch.h"
#include "StringUtil.h"
CFileSearch::CFileSearch(const CFileSearch::XStringVector& _rSearchStrings, const CFileSearch::XStringVector& _rDirectories)
{
// Reverse the loop order for speed?
for (size_t j = 0; j < _rSearchStrings.size(); j++)
{
for (size_t i = 0; i < _rDirectories.size(); i++)
{
FindFiles(_rSearchStrings[j], _rDirectories[i]);
}
}
}
void CFileSearch::FindFiles(const std::string& _searchString, const std::string& _strPath)
{
std::string GCMSearchPath;
BuildCompleteFilename(GCMSearchPath, _strPath, _searchString);
#ifdef _WIN32
WIN32_FIND_DATA findData;
HANDLE FindFirst = FindFirstFile(GCMSearchPath.c_str(), &findData);
if (FindFirst != INVALID_HANDLE_VALUE)
{
bool bkeepLooping = true;
while (bkeepLooping)
{
std::string strFilename;
BuildCompleteFilename(strFilename, _strPath, findData.cFileName);
m_FileNames.push_back(strFilename);
bkeepLooping = FindNextFile(FindFirst, &findData) ? true : false;
}
}
#else
size_t dot_pos = _searchString.rfind(".");
if (dot_pos == std::string::npos)
{
return;
}
std::string ext = _searchString.substr(dot_pos);
DIR* dir = opendir(_strPath.c_str());
if (!dir)
{
return;
}
dirent* dp;
while (true)
{
dp = readdir(dir);
if (!dp)
{
break;
}
std::string s(dp->d_name);
if ( (s.size() > ext.size()) && (!strcasecmp(s.substr(s.size() - ext.size()).c_str(), ext.c_str())) )
{
std::string full_name = _strPath + "/" + s;
m_FileNames.push_back(full_name);
}
}
closedir(dir);
#endif
}
const CFileSearch::XStringVector& CFileSearch::GetFileNames() const
{
return(m_FileNames);
}
-44
View File
@@ -1,44 +0,0 @@
// 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 __FILESEARCH_H_
#define __FILESEARCH_H_
#include <string>
#include <vector>
class CFileSearch
{
public:
typedef std::vector<std::string>XStringVector;
CFileSearch(const XStringVector& _rSearchStrings, const XStringVector& _rDirectories);
const XStringVector& GetFileNames() const;
private:
void FindFiles(const std::string& _searchString, const std::string& _strPath);
XStringVector m_FileNames;
};
#endif
File diff suppressed because it is too large Load Diff
-97
View File
@@ -1,97 +0,0 @@
#ifndef __FRAME_H_
#define __FRAME_H_
class CGameListCtrl;
class CFrame
: public wxFrame
{
public:
CFrame(wxFrame* parent,
wxWindowID id = wxID_ANY,
const wxString& title = _T("Dolphin"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN | wxNO_FULL_REPAINT_ON_RESIZE);
void* GetRenderHandle() {return(m_Panel->GetHandle());}
private:
CGameListCtrl* m_GameListCtrl;
wxPanel* m_Panel;
enum EBitmaps
{
Toolbar_FileOpen,
Toolbar_Refresh,
Toolbar_Browse,
Toolbar_Play,
Toolbar_Play_Dis,
Toolbar_Stop,
Toolbar_Stop_Dis,
Toolbar_Pause,
Toolbar_PluginOptions,
Toolbar_PluginOptions_Dis,
Toolbar_PluginGFX,
Toolbar_PluginDSP,
Toolbar_PluginPAD,
Toolbar_FullScreen,
Toolbar_Help,
Bitmaps_Max
};
wxBitmap m_Bitmaps[Bitmaps_Max];
wxBitmap m_BitmapsMenu[Bitmaps_Max];
void InitBitmaps();
void PopulateToolbar(wxToolBar* toolBar);
void RecreateToolbar();
void CreateMenu();
// event handler
void OnQuit(wxCommandEvent& event);
void OnHelp(wxCommandEvent& event);
void OnRefresh(wxCommandEvent& event);
void OnPluginOptions(wxCommandEvent& event);
void OnPluginGFX(wxCommandEvent& event);
void OnPluginDSP(wxCommandEvent& event);
void OnPluginPAD(wxCommandEvent& event);
void OnOpen(wxCommandEvent& event);
void OnPlay(wxCommandEvent& event);
void OnStop(wxCommandEvent& event);
void OnBrowse(wxCommandEvent& event);
void OnMemcard(wxCommandEvent& event);
void OnToggleFullscreen(wxCommandEvent& event);
void OnToggleDualCore(wxCommandEvent& event);
void OnToggleThrottle(wxCommandEvent& event);
void OnToggleToolbar(wxCommandEvent& event);
void OnKeyDown(wxKeyEvent& event);
void OnHostMessage(wxCommandEvent& event);
void OnLoadState(wxCommandEvent& event);
void OnSaveState(wxCommandEvent& event);
wxStatusBar* m_pStatusBar;
wxMenuBar* m_pMenuBar;
wxMenuItem* m_pMenuItemPlay;
wxMenuItem* m_pMenuItemStop;
wxMenuItem* m_pPluginOptions;
wxMenuItem* m_pMenuItemLoad;
wxMenuItem* m_pMenuItemSave;
wxBusyInfo* m_pBootProcessDialog;
void UpdateGUI();
// old function that could be cool
DECLARE_EVENT_TABLE();
};
#endif // __FRAME_H_
-491
View File
@@ -1,491 +0,0 @@
// 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 "Globals.h"
#include <wx/imaglist.h>
#include <algorithm>
#include "FileSearch.h"
#include "FileUtil.h"
#include "StringUtil.h"
#include "BootManager.h"
#include "Config.h"
#include "GameListCtrl.h"
#if USE_XPM_BITMAPS
#include "../resources/Flag_Europe.xpm"
#include "../resources/Flag_France.xpm"
#include "../resources/Flag_Japan.xpm"
#include "../resources/Flag_USA.xpm"
#endif // USE_XPM_BITMAPS
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_END_DRAG(LIST_CTRL, CGameListCtrl::OnColEndDrag)
EVT_MENU(IDM_EDITPATCHFILE, CGameListCtrl::OnEditPatchFile)
EVT_MENU(IDM_OPENCONTAININGFOLDER, CGameListCtrl::OnOpenContainingFolder)
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();
}
void
CGameListCtrl::InitBitmaps()
{
m_imageListSmall = new wxImageList(96, 32);
SetImageList(m_imageListSmall, wxIMAGE_LIST_SMALL);
m_FlagImageIndex.resize(DiscIO::IVolume::NUMBER_OF_COUNTRIES);
wxIcon iconTemp;
iconTemp.CopyFromBitmap(wxBitmap(Flag_Europe_xpm));
m_FlagImageIndex[DiscIO::IVolume::COUNTRY_EUROPE] = m_imageListSmall->Add(iconTemp);
iconTemp.CopyFromBitmap(wxBitmap(Flag_France_xpm));
m_FlagImageIndex[DiscIO::IVolume::COUNTRY_FRANCE] = m_imageListSmall->Add(iconTemp);
iconTemp.CopyFromBitmap(wxBitmap(Flag_USA_xpm));
m_FlagImageIndex[DiscIO::IVolume::COUNTRY_USA] = m_imageListSmall->Add(iconTemp);
iconTemp.CopyFromBitmap(wxBitmap(Flag_Japan_xpm));
m_FlagImageIndex[DiscIO::IVolume::COUNTRY_JAP] = m_imageListSmall->Add(iconTemp);
iconTemp.CopyFromBitmap(wxBitmap(Flag_Europe_xpm));
m_FlagImageIndex[DiscIO::IVolume::COUNTRY_UNKNOWN] = m_imageListSmall->Add(iconTemp);
}
void
CGameListCtrl::BrowseForDirectory()
{
wxString dirHome;
wxGetHomeDir(&dirHome);
// browse
wxDirDialog dialog(this, _T("Browse directory"), dirHome, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST);
if (dialog.ShowModal() == wxID_OK)
{
SConfig::GetInstance().m_ISOFolder.push_back(
std::string(dialog.GetPath().ToAscii())
);
SConfig::GetInstance().SaveSettings();
Update();
}
}
void
CGameListCtrl::Update()
{
Hide();
ScanForISOs();
ClearAll();
if (m_ISOFiles.size() != 0)
{
// add columns
InsertColumn(COLUMN_BANNER, _T("Banner"));
InsertColumn(COLUMN_TITLE, _T("Title"));
InsertColumn(COLUMN_COMPANY, _T("Company"));
InsertColumn(COLUMN_COUNTRY, _T(""));
InsertColumn(COLUMN_SIZE, _T("Size"));
InsertColumn(COLUMN_EMULATION_STATE, _T("Emulation"), wxLIST_FORMAT_LEFT);
// add all items
for (int i = 0; i < (int)m_ISOFiles.size(); i++)
{
InsertItemInReportView(i);
}
SetItemState(0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
}
else
{
InsertColumn(COLUMN_BANNER, _T("No ISOs found"));
// data
wxString buf(_T("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);
SetItemState(0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
}
AutomaticColumnWidth();
Show();
}
#ifdef _WIN32
wxColour blend50(const wxColour& c1, const wxColour& c2)
{
return(((c1.GetPixel() & 0xFEFEFE) >> 1) + ((c2.GetPixel() & 0xFEFEFE) >> 1) + 0x010101);
}
#endif
wxString NiceSizeFormat(s64 _size)
{
const char* sizes[] = {"b", "KB", "MB", "GB", "TB", "PB", "EB"};
int s = 0;
int frac = 0;
while (_size > (s64)1024)
{
s++;
frac = (int)_size & 1023;
_size /= (s64)1024;
}
float f = (float)_size + ((float)frac / 1024.0f);
wxString NiceString;
char tempstr[32];
sprintf(tempstr,"%3.1f %s", f, sizes[s]);
NiceString = wxString::FromAscii(tempstr);
return(NiceString);
}
void
CGameListCtrl::InsertItemInReportView(size_t _Index)
{
CISOFile& rISOFile = m_ISOFiles[_Index];
int ImageIndex = -1;
if (rISOFile.GetImage().IsOk())
{
ImageIndex = m_imageListSmall->Add(rISOFile.GetImage());
}
// data
wxString buf;
long ItemIndex = InsertItem(_Index, buf, ImageIndex);
#ifdef _WIN32
wxColour color = (_Index & 1) ? blend50(GetSysColor(COLOR_3DLIGHT), GetSysColor(COLOR_WINDOW)) : GetSysColor(COLOR_WINDOW);
#else
wxColour color = (_Index & 1) ? 0xFFFFFF : 0xEEEEEE;
#endif
// background color color
{
wxListItem item;
item.SetId(ItemIndex);
item.SetBackgroundColour(color);
SetItem(item);
}
// title color
{
wxListItem item;
item.SetId(ItemIndex);
item.SetColumn(COLUMN_TITLE);
item.SetText(wxString::FromAscii(rISOFile.GetName().c_str()));
SetItem(item);
}
// company color
{
wxListItem item;
item.SetId(ItemIndex);
item.SetColumn(COLUMN_COMPANY);
item.SetText(wxString::FromAscii(rISOFile.GetCompany().c_str()));
SetItem(item);
}
// size
{
wxListItem item;
item.SetId(ItemIndex);
item.SetColumn(COLUMN_SIZE);
item.SetText(NiceSizeFormat(rISOFile.GetFileSize()));
SetItem(item);
}
#ifndef __WXMSW__
// country
{
// Can't do this in Windows - we use DrawSubItem instead, see below
wxListItem item;
item.m_itemId = ItemIndex;
item.SetColumn(COLUMN_COUNTRY);
item.SetBackgroundColour(color);
DiscIO::IVolume::ECountry Country = rISOFile.GetCountry();
if (size_t(Country) < m_FlagImageIndex.size())
{
item.SetImage(m_FlagImageIndex[rISOFile.GetCountry()]);
}
SetItem(item);
}
#endif // __WXMSW__
// item data
SetItemData(ItemIndex, _Index);
}
void
CGameListCtrl::ScanForISOs()
{
m_ISOFiles.clear();
CFileSearch::XStringVector Directories(SConfig::GetInstance().m_ISOFolder);
CFileSearch::XStringVector Extensions;
Extensions.push_back("*.iso");
Extensions.push_back("*.gcm");
Extensions.push_back("*.gcz");
CFileSearch FileSearch(Extensions, Directories);
const CFileSearch::XStringVector& rFilenames = FileSearch.GetFileNames();
if (rFilenames.size() > 0)
{
wxProgressDialog dialog(_T("Scanning for ISOs"),
_T("Scanning..."),
rFilenames.size(), // range
this, // parent
wxPD_CAN_ABORT |
wxPD_APP_MODAL |
// wxPD_AUTO_HIDE | -- try this as well
wxPD_ELAPSED_TIME |
wxPD_ESTIMATED_TIME |
wxPD_REMAINING_TIME |
wxPD_SMOOTH // - makes indeterminate mode bar on WinXP very small
);
dialog.CenterOnParent();
for (size_t i = 0; i < rFilenames.size(); i++)
{
std::string FileName;
SplitPath(rFilenames[i], NULL, &FileName, NULL);
wxString msg;
char tempstring[128];
sprintf(tempstring,"Scanning %s", FileName.c_str());
msg = wxString::FromAscii(tempstring);
bool Cont = dialog.Update(i, msg);
if (!Cont)
{
break;
}
CISOFile ISOFile(rFilenames[i]);
if (ISOFile.IsValid())
{
m_ISOFiles.push_back(ISOFile);
}
}
}
std::sort(m_ISOFiles.begin(), m_ISOFiles.end());
}
void
CGameListCtrl::OnColBeginDrag(wxListEvent& event)
{
event.Veto();
}
void
CGameListCtrl::OnColEndDrag(wxListEvent& WXUNUSED (event))
{
AutomaticColumnWidth();
}
void
CGameListCtrl::OnRightClick(wxMouseEvent& event)
{
// Focus the clicked item.
int flags;
long item = HitTest(event.GetPosition(), flags);
if (item != wxNOT_FOUND) {
SetItemState(item, wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED,
wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED);
}
const CISOFile *selected_iso = GetSelectedISO();
if (selected_iso) {
std::string unique_id = selected_iso->GetUniqueID();
wxMenu popupMenu;
std::string menu_text = StringFromFormat("Edit &patch file: %s.ini", unique_id.c_str());
popupMenu.Append(IDM_EDITPATCHFILE, wxString::FromAscii(menu_text.c_str())); //Pretty much everything in wxwidgets is a wxString, try to convert to those first!
popupMenu.Append(IDM_OPENCONTAININGFOLDER, wxString::FromAscii("Open &containing folder"));
PopupMenu(&popupMenu);
}
}
void
CGameListCtrl::OnActivated(wxListEvent& event)
{
if (m_ISOFiles.size() == 0)
{
BrowseForDirectory();
}
else
{
size_t Index = event.GetData();
if (Index < m_ISOFiles.size())
{
const CISOFile& rISOFile = m_ISOFiles[Index];
BootManager::BootCore(rISOFile.GetFileName());
}
}
}
const CISOFile *
CGameListCtrl::GetSelectedISO() const
{
int item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (item == -1)
return 0;
else
return &m_ISOFiles[GetItemData(item)];
}
void
CGameListCtrl::OnOpenContainingFolder(wxCommandEvent& WXUNUSED (event)) {
const CISOFile *iso = GetSelectedISO();
if (!iso)
return;
std::string path;
SplitPath(iso->GetFileName(), &path, 0, 0);
File::Explore(path);
}
void
CGameListCtrl::OnEditPatchFile(wxCommandEvent& WXUNUSED (event))
{
const CISOFile *iso = GetSelectedISO();
if (!iso)
return;
std::string filename = "Patches/" + iso->GetUniqueID() + ".ini";
if (!File::Exists(filename)) {
if (AskYesNo("%s.ini does not exist. Do you want to create it?", iso->GetUniqueID().c_str())) {
FILE *f = fopen(filename.c_str(), "w");
fprintf(f, "# %s - %s\r\n\r\n", iso->GetUniqueID().c_str(), iso->GetName().c_str());
fprintf(f, "[OnFrame]\r\n#Add memory patches here.\r\n\r\n");
fprintf(f, "[ActionReplay]\r\n#Add decrypted action replay cheats here.\r\n");
fclose(f);
} else {
return;
}
}
File::Launch(filename);
}
void
CGameListCtrl::OnSelected(wxListEvent& WXUNUSED (event))
{}
void CGameListCtrl::OnSize(wxSizeEvent& WXUNUSED (event))
{
AutomaticColumnWidth();
}
bool
CGameListCtrl::MSWDrawSubItem(wxPaintDC& rPaintDC, int item, int subitem)
{
bool Result = false;
#ifdef __WXMSW__
switch (subitem)
{
case COLUMN_COUNTRY:
{
size_t Index = GetItemData(item);
if (Index < m_ISOFiles.size())
{
const CISOFile& rISO = m_ISOFiles[Index];
wxRect SubItemRect;
this->GetSubItemRect(item, subitem, SubItemRect);
m_imageListSmall->Draw(m_FlagImageIndex[rISO.GetCountry()], rPaintDC, SubItemRect.GetLeft(), SubItemRect.GetTop());
}
}
}
//
#endif
return(Result);
}
void
CGameListCtrl::AutomaticColumnWidth()
{
wxRect rc(GetClientRect());
if (GetColumnCount() == 1)
{
SetColumnWidth(0, rc.GetWidth());
}
else if (GetColumnCount() > 4)
{
SetColumnWidth(COLUMN_COUNTRY, 32);
SetColumnWidth(COLUMN_BANNER, 106);
// width
for (int i = 0; i < GetColumnCount() - 1; i++)
{
if ((i != COLUMN_COUNTRY) && (i != COLUMN_BANNER))
{
SetColumnWidth(i, wxLIST_AUTOSIZE);
}
}
int size = 0;
for (int i = 0; i < GetColumnCount() - 1; i++)
{
size += GetColumnWidth(i);
}
int rest = rc.GetWidth() - size - 3;
if (rest > 0)
{
SetColumnWidth(GetColumnCount() - 1, rest);
}
else
{
SetColumnWidth(GetColumnCount() - 1, 0);
}
}
}
-78
View File
@@ -1,78 +0,0 @@
// 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 __GAMELIST_CTRL_H_
#define __GAMELIST_CTRL_H_
#include <vector>
#include <wx/listctrl.h>
#include "ISOFile.h"
class CGameListCtrl : public wxListCtrl
{
public:
CGameListCtrl(wxWindow* parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style);
void Update();
void BrowseForDirectory();
const CISOFile *GetSelectedISO() const;
private:
enum
{
COLUMN_BANNER = 0,
COLUMN_TITLE,
COLUMN_COMPANY,
COLUMN_COUNTRY,
COLUMN_SIZE,
COLUMN_EMULATION_STATE,
NUMBER_OF_COLUMN
};
std::vector<int>m_FlagImageIndex;
bool m_test;
std::vector<CISOFile> m_ISOFiles;
void InitBitmaps();
void InsertItemInReportView(size_t _Index);
void ScanForISOs();
DECLARE_EVENT_TABLE()
// events
void OnRightClick(wxMouseEvent& 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);
void OnOpenContainingFolder(wxCommandEvent& event);
virtual bool MSWDrawSubItem(wxPaintDC& rPaintDC, int item, int subitem);
void AutomaticColumnWidth();
};
#endif
-18
View File
@@ -1,18 +0,0 @@
// 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 "Globals.h"
-121
View File
@@ -1,121 +0,0 @@
// 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 _GLOBALS_H
#define _GLOBALS_H
enum
{
IDM_LOADSTATE = 200,
IDM_SAVESTATE,
IDM_SAVESLOT1,
IDM_SAVESLOT2,
IDM_SAVESLOT3,
IDM_SAVESLOT4,
IDM_SAVESLOT5,
IDM_SAVESLOT6,
IDM_SAVESLOT7,
IDM_SAVESLOT8,
IDM_SAVESLOT9,
IDM_SAVESLOT10,
IDM_LOADSLOT1,
IDM_LOADSLOT2,
IDM_LOADSLOT3,
IDM_LOADSLOT4,
IDM_LOADSLOT5,
IDM_LOADSLOT6,
IDM_LOADSLOT7,
IDM_LOADSLOT8,
IDM_LOADSLOT9,
IDM_LOADSLOT10,
IDM_PLAY,
IDM_STOP,
IDM_BROWSE,
IDM_MEMCARD,
IDM_EDITPATCHFILE,
IDM_OPENCONTAININGFOLDER,
IDM_PLUGIN_OPTIONS,
IDM_CONFIG_GFX_PLUGIN,
IDM_CONFIG_DSP_PLUGIN,
IDM_CONFIG_PAD_PLUGIN,
IDM_TOGGLE_FULLSCREEN,
IDM_TOGGLE_DUALCORE,
IDM_TOGGLE_TOOLBAR,
IDM_NOTIFYMAPLOADED,
IDM_UPDATELOGDISPLAY,
IDM_UPDATEDISASMDIALOG,
IDM_UPDATEGUI,
IDM_UPDATESTATUSBAR,
IDM_UPDATEBREAKPOINTS,
IDM_HOST_MESSAGE,
IDM_BOOTING_STARTED,
IDM_BOOTING_ENDED,
IDM_HELPABOUT,
IDM_HELPWEBSITE,
IDM_HELPGOOGLECODE,
ID_TOOLBAR = 500,
LIST_CTRL = 1000
};
#define wxUSE_XPM_IN_MSW 1
#define USE_XPM_BITMAPS 1
// For compilers that support precompilation, includes <wx/wx.h>.
//#include <wx/wxprec.h>
//#ifndef WX_PRECOMP
#include <wx/wx.h>
//#endif
#include <wx/toolbar.h>
#include <wx/log.h>
#include <wx/image.h>
#include <wx/aboutdlg.h>
#include <wx/filedlg.h>
#include <wx/spinctrl.h>
#include <wx/srchctrl.h>
#include <wx/listctrl.h>
#include <wx/progdlg.h>
#include <wx/imagpng.h>
#include <wx/button.h>
#include <wx/stattext.h>
#include <wx/choice.h>
#include <wx/cmdline.h>
#include <wx/busyinfo.h>
// define this to use XPMs everywhere (by default, BMPs are used under Win)
// BMPs use less space, but aren't compiled into the executable on other platforms
#if USE_XPM_BITMAPS && defined (__WXMSW__) && !wxUSE_XPM_IN_MSW
#error You need to enable XPM support to use XPM bitmaps with toolbar!
#endif // USE_XPM_BITMAPS
//
// custom message macro
//
#define EVT_HOST_COMMAND(id, fn) \
DECLARE_EVENT_TABLE_ENTRY(\
wxEVT_HOST_COMMAND, id, wxID_ANY, \
(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent(wxCommandEventFunction, &fn), \
(wxObject*) NULL \
),
extern const wxEventType wxEVT_HOST_COMMAND;
#endif
-98
View File
@@ -1,98 +0,0 @@
// 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 <string>
#include <vector>
#include "Globals.h"
#include "ISOFile.h"
#include "VolumeCreator.h"
#include "Filesystem.h"
#include "BannerLoader.h"
#include "FileSearch.h"
#define DVD_BANNER_WIDTH 96
#define DVD_BANNER_HEIGHT 32
static u32 g_ImageTemp[DVD_BANNER_WIDTH * DVD_BANNER_HEIGHT];
CISOFile::CISOFile(const std::string& _rFileName)
: m_FileName(_rFileName),
m_FileSize(0),
m_Valid(false)
{
DiscIO::IVolume* pVolume = DiscIO::CreateVolumeFromFilename(_rFileName);
if (pVolume != NULL)
{
m_Name = _rFileName;
m_Country = pVolume->GetCountry();
m_FileSize = pVolume->GetSize();
m_Name = pVolume->GetName();
m_UniqueID = pVolume->GetUniqueID();
// check if we can get some infos from the banner file too
DiscIO::IFileSystem* pFileSystem = DiscIO::CreateFileSystem(*pVolume);
if (pFileSystem != NULL)
{
DiscIO::IBannerLoader* pBannerLoader = DiscIO::CreateBannerLoader(*pFileSystem);
if (pBannerLoader != NULL)
{
if (pBannerLoader->IsValid())
{
pBannerLoader->GetName(m_Name, 0); //m_Country == DiscIO::IVolume::COUNTRY_JAP ? 1 : 0);
pBannerLoader->GetCompany(m_Company);
if (pBannerLoader->GetBanner(g_ImageTemp))
{
unsigned char* pImage = (unsigned char*)malloc(DVD_BANNER_WIDTH * DVD_BANNER_HEIGHT * 3);
for (size_t i = 0; i < DVD_BANNER_WIDTH * DVD_BANNER_HEIGHT; i++)
{
pImage[i * 3 + 0] = (g_ImageTemp[i] & 0xFF0000) >> 16;
pImage[i * 3 + 1] = (g_ImageTemp[i] & 0x00FF00) >> 8;
pImage[i * 3 + 2] = (g_ImageTemp[i] & 0x0000FF) >> 0;
}
m_Image.Create(DVD_BANNER_WIDTH, DVD_BANNER_HEIGHT, pImage);
}
}
else
{
// default banner
}
delete pBannerLoader;
}
delete pFileSystem;
}
delete pVolume;
m_Valid = true;
}
}
CISOFile::~CISOFile()
{}
-68
View File
@@ -1,68 +0,0 @@
// 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 __ISOFILE_H_
#define __ISOFILE_H_
#include "Volume.h"
class CISOFile
{
public:
CISOFile(const std::string& _rFileName);
~CISOFile();
bool IsValid() const {return(m_Valid);}
const std::string& GetFileName() const {return(m_FileName);}
const std::string& GetName() const {return(m_Name);}
const std::string& GetCompany() const {return(m_Company);}
const std::string& GetUniqueID() const {return(m_UniqueID);}
DiscIO::IVolume::ECountry GetCountry() const {return(m_Country);}
u64 GetFileSize() const {return(m_FileSize);}
const wxImage& GetImage() const {return(m_Image);}
bool operator < (const CISOFile &other) const {
// HACK - they end up in reverse order in the list view
return strcmp(m_Name.c_str(), other.m_Name.c_str()) > 0;
}
private:
std::string m_FileName;
std::string m_Name;
std::string m_Company;
std::string m_UniqueID;
u64 m_FileSize;
DiscIO::IVolume::ECountry m_Country;
wxImage m_Image;
bool m_Valid;
};
#endif
-276
View File
@@ -1,276 +0,0 @@
// 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 <vector>
#include <string>
#ifdef WIN32
#include "svnrev.h"
#endif
#include "CPUDetect.h"
#include "Globals.h"
#include "Common.h"
#include "IniFile.h"
#include "Main.h"
#include "Frame.h"
#include "Config.h"
#include "CodeWindow.h"
#include "ExtendedTrace.h"
IMPLEMENT_APP(DolphinApp)
CFrame* main_frame = NULL;
CCodeWindow* g_pCodeWindow = NULL;
#ifdef WIN32
//Has no error handling.
//I think that if an error occurs here there's no way to handle it anyway.
LONG WINAPI MyUnhandledExceptionFilter(LPEXCEPTION_POINTERS e) {
//EnterCriticalSection(&g_uefcs);
FILE* file=NULL;
fopen_s(&file, "exceptioninfo.txt", "a");
fseek(file, 0, SEEK_END);
etfprint(file, "\n");
//etfprint(file, g_buildtime);
//etfprint(file, "\n");
//dumpCurrentDate(file);
etfprintf(file, "Unhandled Exception\n Code: 0x%08X\n",
e->ExceptionRecord->ExceptionCode);
#ifndef _M_X64
STACKTRACE2(file, e->ContextRecord->Eip, e->ContextRecord->Esp, e->ContextRecord->Ebp);
#else
STACKTRACE2(file, e->ContextRecord->Rip, e->ContextRecord->Rsp, e->ContextRecord->Rbp);
#endif
fclose(file);
_flushall();
//LeaveCriticalSection(&g_uefcs);
return EXCEPTION_CONTINUE_SEARCH;
}
#endif
// The `main program' equivalent, creating the windows and returning the
// main frame
bool DolphinApp::OnInit()
{
DetectCPU();
#ifndef _WIN32
// RegisterPanicAlertHandler(&wxPanicAlert);
#endif
#ifdef _WIN32
EXTENDEDTRACEINITIALIZE(".");
SetUnhandledExceptionFilter(&MyUnhandledExceptionFilter);
// TODO: if First Boot
if (!cpu_info.bSSE2)
{
MessageBox(0, _T("Hi,\n\nDolphin requires that your CPU has support for SSE2 extensions.\n"
"Unfortunately your CPU does not support them, so Dolphin will not run.\n\n"
"Sayonara!\n"), "Dolphin", MB_ICONINFORMATION);
return false;
}
#else
if (!cpu_info.bSSE2)
{
printf("%s", "Hi,\n\nDolphin requires that your CPU has support for SSE2 extensions.\n"
"Unfortunately your CPU does not support them, so Dolphin will not run.\n\n"
"Sayonara!\n");
exit(0);
}
#endif
bool UseDebugger = false;
#if wxUSE_CMDLINE_PARSER
wxCmdLineEntryDesc cmdLineDesc[] =
{
{wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("Show this help message"), wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP},
{wxCMD_LINE_SWITCH, _T("d"), _T("debugger"), _T("Opens the debugger")},
{wxCMD_LINE_NONE}
};
//gets the passed media files from command line
wxCmdLineParser parser(cmdLineDesc, argc, argv);
// get filenames from the command line
if (parser.Parse() != 0)
{
return false;
}
UseDebugger = parser.Found(_T("debugger"));
#endif
SConfig::GetInstance().LoadSettings();
wxInitAllImageHandlers();
// Create the main frame window
#ifdef _WIN32
#ifdef _DEBUG
const char *title = "Dolphin Debug SVN R " SVN_REV_STR;
#else
const char *title = "Dolphin SVN R " SVN_REV_STR;
#endif
#else
#ifdef _DEBUG
const char *title = "Dolphin Debug SVN Linux";
#else
const char *title = "Dolphin SVN Linux";
#endif
#endif
main_frame = new CFrame((wxFrame*) NULL, wxID_ANY, wxString::FromAscii(title),
wxPoint(100, 100), wxSize(800, 600));
// create debugger
if (UseDebugger)
{
g_pCodeWindow = new CCodeWindow(SConfig::GetInstance().m_LocalCoreStartupParameter, main_frame);
g_pCodeWindow->Show(true);
}
SetTopWindow(main_frame);
return true;
}
void DolphinApp::OnEndSession()
{
SConfig::GetInstance().SaveSettings();
}
bool wxPanicAlert(const char* text, bool /*yes_no*/)
{
wxMessageBox(wxString::FromAscii(text), _T("PANIC ALERT"));
return(true);
}
void Host_BootingStarted()
{
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_BOOTING_STARTED);
wxPostEvent(main_frame, event);
if (g_pCodeWindow)
{
wxPostEvent(g_pCodeWindow, event);
}
}
void Host_BootingEnded()
{
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_BOOTING_ENDED);
wxPostEvent(main_frame, event);
if (g_pCodeWindow)
{
wxPostEvent(g_pCodeWindow, event);
}
}
// OK, this thread boundary is DANGEROUS on linux
// wxPostEvent / wxAddPendingEvent is the solution.
void Host_NotifyMapLoaded()
{
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_NOTIFYMAPLOADED);
wxPostEvent(main_frame, event);
if (g_pCodeWindow)
{
wxPostEvent(g_pCodeWindow, event);
}
}
void Host_UpdateLogDisplay()
{
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATELOGDISPLAY);
wxPostEvent(main_frame, event);
if (g_pCodeWindow)
{
wxPostEvent(g_pCodeWindow, event);
}
}
void Host_UpdateDisasmDialog()
{
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATEDISASMDIALOG);
wxPostEvent(main_frame, event);
if (g_pCodeWindow)
{
wxPostEvent(g_pCodeWindow, event);
}
}
void Host_UpdateMainFrame()
{
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATEGUI);
wxPostEvent(main_frame, event);
if (g_pCodeWindow)
{
wxPostEvent(g_pCodeWindow, event);
}
}
void Host_UpdateBreakPointView()
{
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATEBREAKPOINTS);
wxPostEvent(main_frame, event);
if (g_pCodeWindow)
{
wxPostEvent(g_pCodeWindow, event);
}
}
void Host_UpdateMemoryView()
{}
void Host_SetDebugMode(bool)
{}
void Host_SetWaitCursor(bool enable)
{
#ifdef _WIN32
if (enable)
{
SetCursor(LoadCursor(NULL, IDC_WAIT));
}
else
{
SetCursor(LoadCursor(NULL, IDC_ARROW));
}
#endif
}
void Host_UpdateStatusBar(const char* _pText)
{
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATESTATUSBAR);
event.SetString(wxString::FromAscii(_pText));
wxPostEvent(main_frame, event);
}
-32
View File
@@ -1,32 +0,0 @@
// 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 __MAIN_H_
#define __MAIN_H_
// Define a new application
class DolphinApp
: public wxApp
{
public:
bool OnInit();
void OnEndSession();
};
#endif
-89
View File
@@ -1,89 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#ifndef _WIN32
//#include <curses.h>
#else
#endif
#include "Globals.h"
#include "Common.h"
#include "ISOFile.h"
#include "CPUDetect.h"
#include "BootManager.h"
void* g_pCodeWindow = NULL;
void* main_frame = NULL;
bool wxPanicAlert(const char* text, bool /*yes_no*/)
{
return(true);
}
void Host_BootingStarted(){}
void Host_BootingEnded(){}
// OK, this thread boundary is DANGEROUS on linux
// wxPostEvent / wxAddPendingEvent is the solution.
void Host_NotifyMapLoaded(){}
void Host_UpdateLogDisplay(){}
void Host_UpdateDisasmDialog(){}
void Host_UpdateMainFrame(){}
void Host_UpdateBreakPointView(){}
void Host_UpdateMemoryView(){}
void Host_SetDebugMode(bool){}
void Host_SetWaitCursor(bool enable){}
void Host_CreateDisplay(){}
void Host_CloseDisplay(){}
void Host_UpdateStatusBar(const char* _pText){}
// Include SDL header so it can hijack main().
#include <SDL.h>
#include "cmdline.h"
int main(int argc, char* argv[])
{
gengetopt_args_info args_info;
if (cmdline_parser (argc, argv, &args_info) != 0)
return(1);
if (args_info.inputs_num < 1)
{
fprintf(stderr, "Please supply at least one argument - the ISO to boot.\n");
return(1);
}
std::string bootFile(args_info.inputs[0]);
DetectCPU();
BootManager::BootCore(bootFile);
usleep(2000 * 1000 * 1000);
// while (!getch()) {
// usleep(20);
// }
cmdline_parser_free (&args_info);
return(0);
}

Some files were not shown because too many files have changed in this diff Show More