space changes, merge #defines, language fix, and code reorder/cleanup :P

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5614 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
luisr142004 2010-06-05 01:38:22 +00:00
parent c98f8a96d2
commit 2e783d9769
42 changed files with 1870 additions and 1793 deletions

View File

@ -27,12 +27,7 @@
// Force enable logging in the right modes. For some reason, something had changed // Force enable logging in the right modes. For some reason, something had changed
// so that debugfast no longer logged. // so that debugfast no longer logged.
#ifdef _DEBUG #if defined(_DEBUG) || defined(DEBUGFAST)
#undef LOGGING
#define LOGGING 1
#endif
#ifdef DEBUGFAST
#undef LOGGING #undef LOGGING
#define LOGGING 1 #define LOGGING 1
#endif #endif

View File

@ -38,10 +38,10 @@ public:
int Unload(); int Unload();
// Gets a pointer to the function symbol of funcname by getting it from the // Gets a pointer to the function symbol of funcname by getting it from the
// share object // shared object
void *Get(const char *funcname) const; void *Get(const char *funcname) const;
// Returns true is the library is loaded // Returns true if the library is loaded
bool IsLoaded() const { return library != 0; } bool IsLoaded() const { return library != 0; }
private: private:

View File

@ -61,7 +61,7 @@ CPlugin::CPlugin(const char* _szName) : valid(false)
m_EmuStateChange = reinterpret_cast<TEmuStateChange> m_EmuStateChange = reinterpret_cast<TEmuStateChange>
(m_hInstLib.Get("EmuStateChange")); (m_hInstLib.Get("EmuStateChange"));
// Check if the plugin has all the functions it shold have // Check if the plugin has all the functions it should have
if (m_GetDllInfo != 0 && if (m_GetDllInfo != 0 &&
m_DllConfig != 0 && m_DllConfig != 0 &&
m_DllDebugger != 0 && m_DllDebugger != 0 &&

View File

@ -85,7 +85,7 @@ void SConfig::SaveSettings()
ini.Set("General", tmp, m_ISOFolder[i]); ini.Set("General", tmp, m_ISOFolder[i]);
} }
ini.Set("General", "RecersiveGCMPaths", m_RecursiveISOFolder); ini.Set("General", "RecursiveGCMPaths", m_RecursiveISOFolder);
// Interface // Interface
ini.Set("Interface", "ConfirmStop", m_LocalCoreStartupParameter.bConfirmStop); ini.Set("Interface", "ConfirmStop", m_LocalCoreStartupParameter.bConfirmStop);
@ -209,7 +209,7 @@ void SConfig::LoadSettings()
} }
} }
ini.Get("General", "RecersiveGCMPaths", &m_RecursiveISOFolder, false); ini.Get("General", "RecursiveGCMPaths", &m_RecursiveISOFolder, false);
} }
{ {

View File

@ -37,7 +37,7 @@ enum Hotkey {
struct SCoreStartupParameter struct SCoreStartupParameter
{ {
void * hInstance; // HINSTANCE but we don't want to include <windows.h> void* hInstance; // HINSTANCE but we don't want to include <windows.h>
// Windows/GUI related // Windows/GUI related
void* hMainWindow; void* hMainWindow;
@ -93,10 +93,10 @@ struct SCoreStartupParameter
int iHotkeyModifier[NUM_HOTKEYS]; int iHotkeyModifier[NUM_HOTKEYS];
// Display settings // Display settings
bool bFullscreen, bRenderToMain;
std::string strFullscreenResolution; std::string strFullscreenResolution;
int iRenderWindowXPos, iRenderWindowYPos; int iRenderWindowXPos, iRenderWindowYPos;
int iRenderWindowWidth, iRenderWindowHeight; int iRenderWindowWidth, iRenderWindowHeight;
bool bFullscreen, bRenderToMain;
int iTheme; int iTheme;
int iPosX, iPosY, iWidth, iHeight; int iPosX, iPosY, iWidth, iHeight;

View File

@ -46,7 +46,8 @@ bool g_bPolled = false;
int g_numRerecords = 0; int g_numRerecords = 0;
std::string g_recordFile; std::string g_recordFile;
void FrameUpdate() { void FrameUpdate()
{
g_frameCounter++; g_frameCounter++;
if(!g_bPolled) if(!g_bPolled)
@ -80,7 +81,8 @@ void FrameUpdate() {
g_bPolled = false; g_bPolled = false;
} }
void SetFrameSkipping(unsigned int framesToSkip) { void SetFrameSkipping(unsigned int framesToSkip)
{
cs_frameSkip.Enter(); cs_frameSkip.Enter();
g_framesToSkip = framesToSkip; g_framesToSkip = framesToSkip;
@ -94,11 +96,13 @@ void SetFrameSkipping(unsigned int framesToSkip) {
cs_frameSkip.Leave(); cs_frameSkip.Leave();
} }
int FrameSkippingFactor() { int FrameSkippingFactor()
{
return g_framesToSkip; return g_framesToSkip;
} }
void SetPolledDevice() { void SetPolledDevice()
{
g_bPolled = true; g_bPolled = true;
} }
@ -123,11 +127,13 @@ void SetAutoFire(bool bEnabled, u32 keyOne, u32 keyTwo)
g_bFirstKey = true; g_bFirstKey = true;
} }
bool IsAutoFiring() { bool IsAutoFiring()
{
return g_bAutoFire; return g_bAutoFire;
} }
void SetFrameStepping(bool bEnabled) { void SetFrameStepping(bool bEnabled)
{
g_bFrameStep = bEnabled; g_bFrameStep = bEnabled;
} }
void SetFrameStopping(bool bEnabled) { void SetFrameStopping(bool bEnabled) {
@ -164,7 +170,6 @@ void ModifyController(SPADStatus *PadStatus, int controllerID)
PadStatus->triggerRight = 255; PadStatus->triggerRight = 255;
break; break;
} }
} }
void FrameSkipping() void FrameSkipping()

View File

@ -108,8 +108,6 @@ CPluginManager::~CPluginManager()
} }
// Init and Shutdown Plugins // Init and Shutdown Plugins
// ------------ // ------------
// Function: Point the m_pad[] and other variables to a certain plugin // Function: Point the m_pad[] and other variables to a certain plugin
@ -122,10 +120,6 @@ bool CPluginManager::InitPlugins()
} }
strcpy(m_PluginGlobals->game_ini, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str()); strcpy(m_PluginGlobals->game_ini, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
strcpy(m_PluginGlobals->unique_id, SConfig::GetInstance().m_LocalCoreStartupParameter.GetUniqueID().c_str()); strcpy(m_PluginGlobals->unique_id, SConfig::GetInstance().m_LocalCoreStartupParameter.GetUniqueID().c_str());
if (!GetDSP()) {
PanicAlert("Can't init DSP Plugin");
return false;
}
INFO_LOG(CONSOLE, "Before GetVideo\n"); INFO_LOG(CONSOLE, "Before GetVideo\n");
if (!GetVideo()) { if (!GetVideo()) {
@ -134,6 +128,10 @@ bool CPluginManager::InitPlugins()
} }
INFO_LOG(CONSOLE, "After GetVideo\n"); INFO_LOG(CONSOLE, "After GetVideo\n");
if (!GetDSP()) {
PanicAlert("Can't init DSP Plugin");
return false;
}
// Check if we get at least one pad or wiimote // Check if we get at least one pad or wiimote
bool pad = false; bool pad = false;
bool wiimote = false; bool wiimote = false;
@ -379,8 +377,6 @@ void CPluginManager::ScanForPlugins()
} }
/* Create or return the already created plugin pointers. This will be called /* Create or return the already created plugin pointers. This will be called
often for the Pad and Wiimote from the SI_.cpp files. And often for the DSP often for the Pad and Wiimote from the SI_.cpp files. And often for the DSP
from the DSP files. from the DSP files.
@ -442,7 +438,7 @@ Common::PluginVideo *CPluginManager::GetVideo()
// Check if the video plugin has been changed // Check if the video plugin has been changed
if (m_video->GetFilename() == m_params->m_strVideoPlugin) if (m_video->GetFilename() == m_params->m_strVideoPlugin)
return m_video; return m_video;
// Then free the current video plugin, // Then free the current video plugin
else else
FreeVideo(); FreeVideo();
} }

View File

@ -75,10 +75,10 @@ private:
CPluginInfos m_PluginInfos; CPluginInfos m_PluginInfos;
PLUGIN_GLOBALS *m_PluginGlobals; PLUGIN_GLOBALS *m_PluginGlobals;
Common::PluginPAD *m_pad[4];
Common::PluginVideo *m_video; Common::PluginVideo *m_video;
Common::PluginWiimote *m_wiimote[4];
Common::PluginDSP *m_dsp; Common::PluginDSP *m_dsp;
Common::PluginPAD *m_pad[4];
Common::PluginWiimote *m_wiimote[4];
SCoreStartupParameter * m_params; SCoreStartupParameter * m_params;
CPluginManager(); CPluginManager();

File diff suppressed because it is too large Load Diff

View File

@ -39,7 +39,7 @@ public:
long style = wxDEFAULT_DIALOG_STYLE); long style = wxDEFAULT_DIALOG_STYLE);
virtual ~CConfigMain(); virtual ~CConfigMain();
void OnClick(wxMouseEvent& event); void OnOk(wxCommandEvent& event);
void CloseClick(wxCommandEvent& event); void CloseClick(wxCommandEvent& event);
void OnSelectionChanged(wxCommandEvent& event); void OnSelectionChanged(wxCommandEvent& event);
void OnConfig(wxCommandEvent& event); void OnConfig(wxCommandEvent& event);
@ -47,119 +47,131 @@ public:
bool bRefreshList; bool bRefreshList;
private: private:
wxNotebook* Notebook;
DECLARE_EVENT_TABLE(); wxPanel* GeneralPage;
wxPanel* GamecubePage;
wxPanel* DisplayPage;
wxPanel* WiiPage;
wxPanel* PathsPage;
wxPanel* PluginsPage;
wxBoxSizer* sGeneralPage; // General Settings wxBoxSizer* sGeneralPage; // General Settings
wxCheckBox* ConfirmStop, *UsePanicHandlers, *UseFPSForLimiting; wxStaticBoxSizer* sbBasic, *sbAdvanced; // Basic and Advanced sections
wxChoice* InterfaceLang;
wxChoice* Framelimit;
wxRadioBox* Theme;
wxStaticBoxSizer* sbBasic, *sbAdvanced, *sbInterface, *sbDisplay; // Basic
wxCheckBox* AlwaysHLE_BS2;
wxRadioButton* m_RadioInt;
wxRadioButton* m_RadioJIT;
wxRadioButton* m_RadioJITIL;
wxCheckBox* CPUThread; wxCheckBox* CPUThread;
wxCheckBox* DSPThread;
wxCheckBox* LockThreads;
wxCheckBox* SkipIdle; wxCheckBox* SkipIdle;
wxCheckBox* EnableCheats; wxCheckBox* EnableCheats;
wxChoice* Framelimit;
wxCheckBox* UseFPSForLimiting;
// Display settings // Advanced
wxBoxSizer* sDisplayPage; wxCheckBox* AlwaysHLE_BS2;
wxCheckBox* HideCursor; wxRadioBox* CPUEngine;
wxCheckBox* Fullscreen; wxCheckBox* DSPThread;
wxCheckBox* LockThreads;
wxBoxSizer* sDisplayPage; // Display settings
wxStaticBoxSizer* sbDisplay, *sbInterface; // Display and Interface sections
// Display
wxChoice* FullscreenResolution; wxChoice* FullscreenResolution;
wxSpinCtrl *WindowWidth; wxSpinCtrl* WindowWidth, *WindowHeight;
wxSpinCtrl *WindowHeight; wxCheckBox* Fullscreen;
wxCheckBox* HideCursor;
wxCheckBox* RenderToMain; wxCheckBox* RenderToMain;
// Interface
wxCheckBox* ConfirmStop;
wxCheckBox* UsePanicHandlers;
wxRadioBox* Theme;
wxChoice* InterfaceLang;
wxButton* HotkeyConfig; wxButton* HotkeyConfig;
wxBoxSizer* sGamecube; // GC settings
wxBoxSizer* sGamecubePage; // GC settings
wxStaticBoxSizer* sbGamecubeIPLSettings; wxStaticBoxSizer* sbGamecubeIPLSettings;
wxGridBagSizer* sGamecubeIPLSettings; wxGridBagSizer* sGamecubeIPLSettings;
wxStaticText* GCSystemLangText;
// IPL
wxChoice* GCSystemLang; wxChoice* GCSystemLang;
wxChoice *GCEXIDevice[3];
wxButton *GCMemcardPath[2];
wxChoice *GCSIDevice[4];
wxBoxSizer* sWii; // Wii settings // Device
wxStaticBoxSizer* sbWiimoteSettings; wxChoice* GCEXIDevice[3];
wxGridBagSizer* sWiimoteSettings; wxButton* GCMemcardPath[2];
wxStaticBoxSizer* sbWiiIPLSettings; wxChoice* GCSIDevice[4];
wxGridBagSizer* sWiiIPLSettings;
wxStaticBoxSizer* sbWiiDeviceSettings;
wxBoxSizer* sPaths;
wxStaticBoxSizer* sbISOPaths;
wxBoxSizer* sISOButtons;
wxGridBagSizer* sOtherPaths;
wxBoxSizer* sPlugins;
wxStaticBoxSizer* sbGraphicsPlugin;
wxStaticBoxSizer* sbDSPPlugin;
wxStaticBoxSizer* sbPadPlugin;
wxStaticBoxSizer* sbWiimotePlugin;
wxNotebook *Notebook;
wxPanel *GeneralPage;
wxPanel *DisplayPage;
wxPanel *GamecubePage;
wxPanel *WiiPage;
wxPanel *PathsPage;
wxPanel *PluginPage;
wxButton* m_Close; wxBoxSizer* sWiiPage; // Wii settings
wxStaticBoxSizer* sbWiimoteSettings, *sbWiiIPLSettings, *sbWiiDeviceSettings; // Wiimote, Misc and Device sections
wxGridBagSizer* sWiimoteSettings, *sWiiIPLSettings;
FILE* pStream; // Wiimote
wxStaticText* WiiSensBarPosText;
wxChoice* WiiSensBarPos; wxChoice* WiiSensBarPos;
wxCheckBox* WiiScreenSaver; // IPL settings // Misc
wxCheckBox* WiiScreenSaver;
wxCheckBox* WiiProgressiveScan; wxCheckBox* WiiProgressiveScan;
wxCheckBox* WiiEuRGB60; wxCheckBox* WiiEuRGB60;
wxStaticText* WiiAspectRatioText;
wxChoice* WiiAspectRatio; wxChoice* WiiAspectRatio;
wxStaticText* WiiSystemLangText;
wxChoice* WiiSystemLang; wxChoice* WiiSystemLang;
// Device
wxCheckBox* WiiSDCard; wxCheckBox* WiiSDCard;
wxCheckBox* WiiKeyboard; wxCheckBox* WiiKeyboard;
wxBoxSizer* sPathsPage; // Paths settings
wxStaticBoxSizer* sbISOPaths;
wxGridBagSizer* sOtherPaths;
// ISO Directories
wxListBox* ISOPaths; wxListBox* ISOPaths;
wxCheckBox* RecursiveISOPath;
wxButton* AddISOPath; wxButton* AddISOPath;
wxButton* RemoveISOPath; wxButton* RemoveISOPath;
wxCheckBox* RecersiveISOPath;
wxStaticText* DefaultISOText; // DefaultISO, DVD Root, Apploader
wxFilePickerCtrl* DefaultISO; wxFilePickerCtrl* DefaultISO;
wxStaticText* DVDRootText;
wxDirPickerCtrl* DVDRoot; wxDirPickerCtrl* DVDRoot;
wxStaticText* ApploaderPathText;
wxFilePickerCtrl* ApploaderPath; wxFilePickerCtrl* ApploaderPath;
wxStaticText* PADText;
wxButton* PADConfig;
wxChoice* PADSelection;
wxButton* DSPConfig;
wxStaticText* DSPText;
wxChoice* DSPSelection;
wxButton* GraphicConfig;
wxStaticText* GraphicText;
wxChoice* GraphicSelection;
wxButton* WiimoteConfig;
wxStaticText* WiimoteText;
wxChoice* WiimoteSelection;
wxArrayString arrayStringFor_InterfaceLang; wxBoxSizer* sPluginsPage; // Plugins settings
wxStaticBoxSizer* sbGraphicsPlugin, *sbDSPPlugin, *sbPadPlugin, *sbWiimotePlugin; // Graphics, DSP, Pad and Wiimote sections
// Graphics
wxChoice* GraphicSelection;
wxButton* GraphicConfig;
// DSP
wxChoice* DSPSelection;
wxButton* DSPConfig;
// Pad
wxChoice* PADSelection;
wxButton* PADConfig;
// Wiimote
wxChoice* WiimoteSelection;
wxButton* WiimoteConfig;
wxButton* m_Ok;
FILE* pStream;
wxArrayString arrayStringFor_Framelimit; wxArrayString arrayStringFor_Framelimit;
wxArrayString arrayStringFor_CPUEngine;
wxArrayString arrayStringFor_Themes;
wxArrayString arrayStringFor_InterfaceLang;
wxArrayString arrayStringFor_FullscreenResolution;
wxArrayString arrayStringFor_GCSystemLang; wxArrayString arrayStringFor_GCSystemLang;
wxArrayString arrayStringFor_WiiSensBarPos; wxArrayString arrayStringFor_WiiSensBarPos;
wxArrayString arrayStringFor_WiiAspectRatio; wxArrayString arrayStringFor_WiiAspectRatio;
wxArrayString arrayStringFor_WiiSystemLang; wxArrayString arrayStringFor_WiiSystemLang;
wxArrayString arrayStringFor_ISOPaths; wxArrayString arrayStringFor_ISOPaths;
wxArrayString arrayStringFor_Themes;
wxArrayString arrayStringFor_FullscreenResolution;
enum enum
{ {
@ -171,33 +183,36 @@ private:
ID_PATHSPAGE, ID_PATHSPAGE,
ID_PLUGINPAGE, ID_PLUGINPAGE,
ID_ALWAYS_HLE_BS2,
ID_RADIOJIT,
ID_RADIOJITIL,
ID_RADIOINT,
ID_CPUTHREAD, ID_CPUTHREAD,
ID_DSPTHREAD,
ID_LOCKTHREADS,
ID_IDLESKIP, ID_IDLESKIP,
ID_ENABLECHEATS, ID_ENABLECHEATS,
ID_FRAMELIMIT_TEXT, ID_FRAMELIMIT,
ID_FRAMELIMIT_USEFPSFORLIMITING,
ID_ALWAYS_HLE_BS2,
ID_CPUENGINE,
ID_LOCKTHREADS,
ID_DSPTHREAD,
ID_INTERFACE_CONFIRMSTOP, // Interface settings
ID_INTERFACE_USEPANICHANDLERS,
ID_DISPLAY_FULLSCREENRES, ID_DISPLAY_FULLSCREENRES,
ID_DISPLAY_WINDOWWIDTH, ID_DISPLAY_WINDOWWIDTH,
ID_DISPLAY_WINDOWHEIGHT, ID_DISPLAY_WINDOWHEIGHT,
ID_DISPLAY_FULLSCREEN, ID_DISPLAY_FULLSCREEN,
ID_DISPLAY_HIDECURSOR, ID_DISPLAY_HIDECURSOR,
ID_DISPLAY_RENDERTOMAIN, ID_DISPLAY_RENDERTOMAIN,
ID_HOTKEY_CONFIG,
ID_INTERFACE_LANG_TEXT, ID_INTERFACE_LANG, // Interface settings
ID_INTERFACE_CONFIRMSTOP,
ID_INTERFACE_USEPANICHANDLERS,
ID_INTERFACE_THEME, ID_INTERFACE_THEME,
ID_FRAMELIMIT_TEXT, ID_INTERFACE_LANG_TEXT, ID_INTERFACE_LANG,
ID_FRAMELIMIT, ID_HOTKEY_CONFIG,
ID_FRAMELIMIT_USEFPSFORLIMITING,
ID_GC_SRAM_LNG_TEXT, ID_GC_SRAM_LNG_TEXT,
ID_GC_SRAM_LNG, ID_GC_SRAM_LNG,
ID_GC_EXIDEVICE_SLOTA_TEXT, ID_GC_EXIDEVICE_SLOTA_TEXT,
ID_GC_EXIDEVICE_SLOTA, ID_GC_EXIDEVICE_SLOTA,
ID_GC_EXIDEVICE_SLOTA_PATH, ID_GC_EXIDEVICE_SLOTA_PATH,
@ -212,8 +227,10 @@ private:
ID_GC_SIDEVICE2, ID_GC_SIDEVICE2,
ID_GC_SIDEVICE3, ID_GC_SIDEVICE3,
ID_WII_BT_BAR_TEXT, ID_WII_BT_BAR_TEXT,
ID_WII_BT_BAR, ID_WII_BT_BAR,
ID_WII_IPL_SSV, ID_WII_IPL_SSV,
ID_WII_IPL_PGS, ID_WII_IPL_PGS,
ID_WII_IPL_E60, ID_WII_IPL_E60,
@ -221,13 +238,16 @@ private:
ID_WII_IPL_AR, ID_WII_IPL_AR,
ID_WII_IPL_LNG_TEXT, ID_WII_IPL_LNG_TEXT,
ID_WII_IPL_LNG, ID_WII_IPL_LNG,
ID_WII_SD_CARD, ID_WII_SD_CARD,
ID_WII_KEYBOARD, ID_WII_KEYBOARD,
ID_ISOPATHS, ID_ISOPATHS,
ID_RECURSIVEISOPATH,
ID_ADDISOPATH, ID_ADDISOPATH,
ID_REMOVEISOPATH, ID_REMOVEISOPATH,
ID_RECERSIVEISOPATH,
ID_DEFAULTISO_TEXT, ID_DEFAULTISO_TEXT,
ID_DEFAULTISO, ID_DEFAULTISO,
ID_DVDROOT_TEXT, ID_DVDROOT_TEXT,
@ -235,22 +255,26 @@ private:
ID_APPLOADERPATH_TEXT, ID_APPLOADERPATH_TEXT,
ID_APPLOADERPATH, ID_APPLOADERPATH,
ID_WIIMOTE_ABOUT,
ID_WIIMOTE_CONFIG, ID_GRAPHIC_TEXT,
ID_WIIMOTE_TEXT, ID_GRAPHIC_CB,
ID_WIIMOTE_CB, ID_GRAPHIC_CONFIG,
ID_PAD_TEXT, ID_GRAPHIC_ABOUT,
ID_PAD_ABOUT ,
ID_PAD_CONFIG,
ID_PAD_CB,
ID_DSP_ABOUT,
ID_DSP_CONFIG,
ID_DSP_TEXT, ID_DSP_TEXT,
ID_DSP_CB, ID_DSP_CB,
ID_GRAPHIC_ABOUT, ID_DSP_CONFIG,
ID_GRAPHIC_CONFIG, ID_DSP_ABOUT,
ID_GRAPHIC_TEXT,
ID_GRAPHIC_CB ID_PAD_TEXT,
ID_PAD_CB,
ID_PAD_CONFIG,
ID_PAD_ABOUT,
ID_WIIMOTE_TEXT,
ID_WIIMOTE_CB,
ID_WIIMOTE_CONFIG,
ID_WIIMOTE_ABOUT
}; };
void InitializeGUILists(); void InitializeGUILists();
@ -260,13 +284,20 @@ private:
void CreateGUIControls(); void CreateGUIControls();
void UpdateGUI(); void UpdateGUI();
void OnClose(wxCloseEvent& event); void OnClose(wxCloseEvent& event);
void OnSpin(wxSpinEvent& event);
void CoreSettingsChanged(wxCommandEvent& event); void CoreSettingsChanged(wxCommandEvent& event);
void DisplaySettingsChanged(wxCommandEvent& event);
void AddResolutions();
void OnSpin(wxSpinEvent& event);
void GCSettingsChanged(wxCommandEvent& event); void GCSettingsChanged(wxCommandEvent& event);
void ChooseMemcardPath(std::string& strMemcard, bool isSlotA); void ChooseMemcardPath(std::string& strMemcard, bool isSlotA);
void ChooseSIDevice(std::string deviceName, int deviceNum); void ChooseSIDevice(std::string deviceName, int deviceNum);
void ChooseEXIDevice(std::string deviceName, int deviceNum); void ChooseEXIDevice(std::string deviceName, int deviceNum);
void WiiSettingsChanged(wxCommandEvent& event); void WiiSettingsChanged(wxCommandEvent& event);
void ISOPathsSelectionChanged(wxCommandEvent& event); void ISOPathsSelectionChanged(wxCommandEvent& event);
void RecursiveDirectoryChanged(wxCommandEvent& event); void RecursiveDirectoryChanged(wxCommandEvent& event);
void AddRemoveISOPaths(wxCommandEvent& event); void AddRemoveISOPaths(wxCommandEvent& event);
@ -277,6 +308,6 @@ private:
void FillChoiceBox(wxChoice* _pChoice, int _PluginType, const std::string& _SelectFilename); void FillChoiceBox(wxChoice* _pChoice, int _PluginType, const std::string& _SelectFilename);
void CallConfig(wxChoice* _pChoice); void CallConfig(wxChoice* _pChoice);
bool GetFilename(wxChoice* _pChoice, std::string& _rFilename); bool GetFilename(wxChoice* _pChoice, std::string& _rFilename);
void AddResolutions(); DECLARE_EVENT_TABLE();
}; };
#endif #endif

View File

@ -357,7 +357,6 @@ CFrame::CFrame(wxFrame* parent,
#if wxUSE_TIMER #if wxUSE_TIMER
, m_timer(this) , m_timer(this)
#endif #endif
{ {
if (ShowLogWindow) SConfig::GetInstance().m_InterfaceLogWindow = true; if (ShowLogWindow) SConfig::GetInstance().m_InterfaceLogWindow = true;
@ -930,11 +929,13 @@ wxFrame * CFrame::CreateParentFrame(wxWindowID Id, const wxString& Title, wxWind
Frame->Show(); Frame->Show();
return Frame; return Frame;
} }
wxPanel* CFrame::CreateEmptyPanel(wxWindowID Id) wxPanel* CFrame::CreateEmptyPanel(wxWindowID Id)
{ {
wxPanel* Panel = new wxPanel(this, Id); wxPanel* Panel = new wxPanel(this, Id);
return Panel; return Panel;
} }
wxAuiNotebook* CFrame::CreateEmptyNotebook() wxAuiNotebook* CFrame::CreateEmptyNotebook()
{ {
wxAuiNotebook* NB = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, NOTEBOOK_STYLE); wxAuiNotebook* NB = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, NOTEBOOK_STYLE);

View File

@ -1311,7 +1311,7 @@ void CFrame::UpdateGUI()
} }
else else
{ {
// Game has been loaded, enable the play button // Game has been loaded, enable the pause button
if (m_ToolBar) if (m_ToolBar)
m_ToolBar->EnableTool(IDM_PLAY, true); m_ToolBar->EnableTool(IDM_PLAY, true);
GetMenuBar()->FindItem(IDM_PLAY)->Enable(true); GetMenuBar()->FindItem(IDM_PLAY)->Enable(true);
@ -1424,4 +1424,3 @@ void CFrame::OnToggleStatusbar(wxCommandEvent& event)
this->SendSizeEvent(); this->SendSizeEvent();
} }

View File

@ -189,25 +189,25 @@ bool DolphinApp::OnInit()
return false; return false;
} }
#if wxCHECK_VERSION(2, 9, 0) #if wxCHECK_VERSION(2, 9, 0)
UseDebugger = parser.Found("debugger"); UseDebugger = parser.Found(wxT("debugger"));
UseLogger = parser.Found("logger"); UseLogger = parser.Found(wxT("logger"));
LoadElf = parser.Found("elf", &ElfFile); LoadElf = parser.Found(wxT("elf"), &ElfFile);
#else #else
UseDebugger = parser.Found(_("debugger")); UseDebugger = parser.Found(wxT("debugger"));
UseLogger = parser.Found(_("logger")); UseLogger = parser.Found(wxT("logger"));
LoadElf = parser.Found(_("elf"), &ElfFile); LoadElf = parser.Found(wxT("elf"), &ElfFile);
#endif #endif
#if wxCHECK_VERSION(2, 9, 0) #if wxCHECK_VERSION(2, 9, 0)
selectVideoPlugin = parser.Found("video_plugin", &videoPluginFilename); selectVideoPlugin = parser.Found(wxT("video_plugin"), &videoPluginFilename);
selectAudioPlugin = parser.Found("audio_plugin", &audioPluginFilename); selectAudioPlugin = parser.Found(wxT("audio_plugin"), &audioPluginFilename);
selectPadPlugin = parser.Found("pad_plugin", &padPluginFilename); selectPadPlugin = parser.Found(wxT"pad_plugin", &padPluginFilename);
selectWiimotePlugin = parser.Found("wiimote_plugin", &wiimotePluginFilename); selectWiimotePlugin = parser.Found(wxT("wiimote_plugin"), &wiimotePluginFilename);
#else #else
selectVideoPlugin = parser.Found(_T("video_plugin"), &videoPluginFilename); selectVideoPlugin = parser.Found(wxT("video_plugin"), &videoPluginFilename);
selectAudioPlugin = parser.Found(_T("audio_plugin"), &audioPluginFilename); selectAudioPlugin = parser.Found(wxT("audio_plugin"), &audioPluginFilename);
selectPadPlugin = parser.Found(_T("pad_plugin"), &padPluginFilename); selectPadPlugin = parser.Found(_T("pad_plugin"), &padPluginFilename);
selectWiimotePlugin = parser.Found(_T("wiimote_plugin"), &wiimotePluginFilename); selectWiimotePlugin = parser.Found(wxT("wiimote_plugin"), &wiimotePluginFilename);
#endif #endif
#endif // wxUSE_CMDLINE_PARSER #endif // wxUSE_CMDLINE_PARSER
@ -378,12 +378,10 @@ bool DolphinApp::OnInit()
// Create the window title // Create the window title
#ifdef _DEBUG #ifdef _DEBUG
const char *title = "Dolphin Debug SVN R " SVN_REV_STR; const char *title = "Dolphin Debug SVN R " SVN_REV_STR;
#else #elif defined DEBUGFAST
#ifdef DEBUGFAST
const char *title = "Dolphin Debugfast SVN R " SVN_REV_STR; const char *title = "Dolphin Debugfast SVN R " SVN_REV_STR;
#else #else
const char *title = "Dolphin SVN R " SVN_REV_STR; const char *title = "Dolphin SVN R " SVN_REV_STR;
#endif
#endif #endif
int x = SConfig::GetInstance().m_LocalCoreStartupParameter.iPosX; int x = SConfig::GetInstance().m_LocalCoreStartupParameter.iPosX;

View File

@ -56,7 +56,7 @@ bool SearchDevices(std::vector<CONTROLLER_INFO> &_joyinfo, int &_NumPads, int &_
// Get device status // Get device status
int numjoy = SDL_NumJoysticks(); int numjoy = SDL_NumJoysticks();
for (int i = 0; i < numjoy; i++ ) for (int i = 0; i < numjoy; i++)
{ {
CONTROLLER_INFO Tmp; CONTROLLER_INFO Tmp;
@ -97,12 +97,12 @@ bool SearchDevices(std::vector<CONTROLLER_INFO> &_joyinfo, int &_NumPads, int &_
// Avoid extreme axis values // Avoid extreme axis values
// --------------------- // ---------------------
/* Function: We have to avoid very big values to becuse some triggers are -0x8000 in the /* Function: We have to avoid very big values because some triggers are -0x8000 in the
unpressed state (and then go from -0x8000 to 0x8000 as they are fully pressed) */ unpressed state (and then go from -0x8000 to 0x8000 as they are fully pressed) */
bool AvoidValues(int value, bool NoTriggerFilter) bool AvoidValues(int value, bool NoTriggerFilter)
{ {
// Avoid detecting very small or very big (for triggers) values // Avoid detecting very small or very big (for triggers) values
if( (value > -0x1000 && value < 0x1000) // Small values if((value > -0x1000 && value < 0x1000) // Small values
|| ((value < -0x7000 || value > 0x7000) && !NoTriggerFilter)) // Big values || ((value < -0x7000 || value > 0x7000) && !NoTriggerFilter)) // Big values
return true; // Avoid return true; // Avoid
else else

View File

@ -51,6 +51,7 @@ struct CONTROLER_STATE
XINPUT_STATE state; XINPUT_STATE state;
bool bConnected; bool bConnected;
}; };
CONTROLER_STATE g_Controllers[MAX_CONTROLLERS]; CONTROLER_STATE g_Controllers[MAX_CONTROLLERS];
@ -81,7 +82,6 @@ void Init()
} }
// Get the trigger status // Get the trigger status
// ------------------- // -------------------
int GetXI(int Controller, int Button) int GetXI(int Controller, int Button)
@ -105,7 +105,6 @@ int GetXI(int Controller, int Button)
} }
} }
// Check if a certain controller is connected // Check if a certain controller is connected
// ------------------- // -------------------
bool IsConnected(int Controller) bool IsConnected(int Controller)

View File

@ -36,7 +36,6 @@ void Init();
int GetXI(int Controller, int Button); int GetXI(int Controller, int Button);
bool IsConnected(int Controller); bool IsConnected(int Controller);
} // XInput } // XInput
#endif #endif

View File

@ -17,6 +17,7 @@
#include <cmath> #include <cmath>
#include "VideoConfig.h"
#include "Profiler.h" #include "Profiler.h"
#include "Statistics.h" #include "Statistics.h"
#include "Render.h" #include "Render.h"
@ -59,7 +60,7 @@ void BPWritten(const BPCmd& bp)
NOTE3: This controls the register groups: RAS1/2, SU, TF, TEV, C/Z, PEC NOTE3: This controls the register groups: RAS1/2, SU, TF, TEV, C/Z, PEC
TODO: Turn into function table. The (future) DisplayList (DL) jit can then call the functions directly, TODO: Turn into function table. The (future) DisplayList (DL) jit can then call the functions directly,
getting rid of dynamic dispatch. Unfortunately, few games use DLs properly - most\ getting rid of dynamic dispatch. Unfortunately, few games use DLs properly - most\
just stuff geometry in them and don't put state changes there. just stuff geometry in them and don't put state changes there
---------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------
*/ */
@ -89,7 +90,7 @@ void BPWritten(const BPCmd& bp)
{ {
case BPMEM_GENMODE: // Set the Generation Mode case BPMEM_GENMODE: // Set the Generation Mode
{ {
PRIM_LOG("genmode: texgen=%d, col=%d, ms_en=%d, tev=%d, culmode=%d, ind=%d, zfeeze=%d", PRIM_LOG("genmode: texgen=%d, col=%d, ms_en=%d, tev=%d, cullmode=%d, ind=%d, zfeeze=%d",
bpmem.genMode.numtexgens, bpmem.genMode.numcolchans, bpmem.genMode.numtexgens, bpmem.genMode.numcolchans,
bpmem.genMode.ms_en, bpmem.genMode.numtevstages+1, bpmem.genMode.cullmode, bpmem.genMode.ms_en, bpmem.genMode.numtevstages+1, bpmem.genMode.cullmode,
bpmem.genMode.numindstages, bpmem.genMode.zfreeze); bpmem.genMode.numindstages, bpmem.genMode.zfreeze);
@ -395,7 +396,7 @@ void BPWritten(const BPCmd& bp)
9 BC1 - Ind. Tex Stage 1 NTexCoord 9 BC1 - Ind. Tex Stage 1 NTexCoord
6 BI1 - Ind. Tex Stage 1 NTexMap 6 BI1 - Ind. Tex Stage 1 NTexMap
3 BC0 - Ind. Tex Stage 0 NTexCoord 3 BC0 - Ind. Tex Stage 0 NTexCoord
0 BI0 - Ind. Tex Stage 0 NTexMap */ 0 BI0 - Ind. Tex Stage 0 NTexMap*/
case BPMEM_TEV_KSEL: // Texture Environment Swap Mode Table 0 case BPMEM_TEV_KSEL: // Texture Environment Swap Mode Table 0
case BPMEM_TEV_KSEL+1:// Texture Environment Swap Mode Table 1 case BPMEM_TEV_KSEL+1:// Texture Environment Swap Mode Table 1
case BPMEM_TEV_KSEL+2:// Texture Environment Swap Mode Table 2 case BPMEM_TEV_KSEL+2:// Texture Environment Swap Mode Table 2

View File

@ -521,7 +521,7 @@ void VertexShaderManager::SetViewport(float* _Viewport, int constantIndex)
{ {
xfregs.rawViewport[constantIndex] = _Viewport[0]; xfregs.rawViewport[constantIndex] = _Viewport[0];
} }
/*//Tino: i think this is nod needed so let this commented til confirmed /*//Tino: i think this is not needed so leave this commented till confirmed
// Workaround for paper mario, yep this is bizarre. // Workaround for paper mario, yep this is bizarre.
for (size_t i = 0; i < ARRAYSIZE(xfregs.rawViewport); ++i) for (size_t i = 0; i < ARRAYSIZE(xfregs.rawViewport); ++i)
{ {

View File

@ -23,7 +23,6 @@ enum PLUGIN_COMM
WM_USER_CREATE, WM_USER_CREATE,
WM_USER_SETCURSOR, WM_USER_SETCURSOR,
WM_USER_KEYDOWN, WM_USER_KEYDOWN,
WM_USER_VIDEO_STOP,
VIDEO_DESTROY, // The video debugging window was destroyed VIDEO_DESTROY, // The video debugging window was destroyed
AUDIO_DESTROY, // The audio debugging window was destroyed AUDIO_DESTROY, // The audio debugging window was destroyed
WIIMOTE_DISCONNECT, // Disconnect Wiimote WIIMOTE_DISCONNECT, // Disconnect Wiimote

View File

@ -40,14 +40,14 @@ public:
private: private:
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
wxSlider *m_volumeSlider; wxSlider* m_volumeSlider;
wxStaticText *m_volumeText; wxStaticText* m_volumeText;
wxButton *m_OK; wxButton* m_OK;
wxCheckBox *m_buttonEnableHLEAudio; wxCheckBox* m_buttonEnableHLEAudio;
wxCheckBox *m_buttonEnableDTKMusic; wxCheckBox* m_buttonEnableDTKMusic;
wxCheckBox *m_buttonEnableThrottle; wxCheckBox* m_buttonEnableThrottle;
wxArrayString wxArrayBackends; wxArrayString wxArrayBackends;
wxChoice *m_BackendSelection; wxChoice* m_BackendSelection;
enum enum
{ {

View File

@ -129,13 +129,11 @@ void GetDllInfo(PLUGIN_INFO* _PluginInfo)
_PluginInfo->Version = 0x0100; _PluginInfo->Version = 0x0100;
_PluginInfo->Type = PLUGIN_TYPE_DSP; _PluginInfo->Type = PLUGIN_TYPE_DSP;
#ifdef DEBUGFAST #ifdef DEBUGFAST
sprintf(_PluginInfo->Name, "Dolphin DSP-HLE Plugin (DebugFast) "); sprintf(_PluginInfo->Name, "Dolphin DSP-HLE Plugin (DebugFast)");
#elif defined _DEBUG
sprintf(_PluginInfo->Name, "Dolphin DSP-HLE Plugin (Debug)");
#else #else
#ifndef _DEBUG sprintf(_PluginInfo->Name, "Dolphin DSP-HLE Plugin");
sprintf(_PluginInfo->Name, "Dolphin DSP-HLE Plugin ");
#else
sprintf(_PluginInfo->Name, "Dolphin DSP-HLE Plugin (Debug) ");
#endif
#endif #endif
} }
@ -143,7 +141,7 @@ void GetDllInfo(PLUGIN_INFO* _PluginInfo)
void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals) void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
{ {
globals = _pPluginGlobals; globals = _pPluginGlobals;
LogManager::SetInstance((LogManager *)globals->logManager); LogManager::SetInstance((LogManager*)globals->logManager);
} }
void DllConfig(HWND _hParent) void DllConfig(HWND _hParent)
@ -198,10 +196,6 @@ void Initialize(void *init)
CDSPHandler::CreateInstance(); CDSPHandler::CreateInstance();
} }
void DSP_StopSoundStream()
{
}
void Shutdown() void Shutdown()
{ {
AudioCommon::ShutdownSoundStream(); AudioCommon::ShutdownSoundStream();

View File

@ -312,6 +312,7 @@ void Close()
if (back_buffer_z) if (back_buffer_z)
back_buffer_z->Release(); back_buffer_z->Release();
back_buffer_z = NULL; back_buffer_z = NULL;
if( back_buffer )
back_buffer->Release(); back_buffer->Release();
back_buffer = NULL; back_buffer = NULL;
@ -319,7 +320,7 @@ void Close()
if (references) if (references)
ERROR_LOG(VIDEO, "Unreleased references: %i.", references); ERROR_LOG(VIDEO, "Unreleased references: %i.", references);
dev = 0; dev = NULL;
} }
const D3DCAPS9 &GetCaps() const D3DCAPS9 &GetCaps()
@ -355,12 +356,20 @@ void ShowD3DError(HRESULT err)
{ {
switch (err) switch (err)
{ {
case D3DERR_DEVICELOST: PanicAlert("Device Lost"); break; case D3DERR_DEVICELOST:
case D3DERR_INVALIDCALL: PanicAlert("Invalid Call"); break; PanicAlert("Device Lost");
case D3DERR_DRIVERINTERNALERROR: PanicAlert("Driver Internal Error"); break; break;
case D3DERR_OUTOFVIDEOMEMORY: PanicAlert("Out of vid mem"); break; case D3DERR_INVALIDCALL:
PanicAlert("Invalid Call");
break;
case D3DERR_DRIVERINTERNALERROR:
PanicAlert("Driver Internal Error");
break;
case D3DERR_OUTOFVIDEOMEMORY:
PanicAlert("Out of vid mem");
break;
default: default:
// MessageBoxA(0,"Other error or success","ERROR",0); // MessageBox(0,_T("Other error or success"),_T("ERROR"),0);
break; break;
} }
} }

View File

@ -193,10 +193,10 @@ bool DXCheck( std::wstring& msg )
HINSTANCE hDll = LoadLibrary(StringFromFormat( _T("d3dx9_%d.dll"), D3DX_SDK_VERSION).c_str()); HINSTANCE hDll = LoadLibrary(StringFromFormat( _T("d3dx9_%d.dll"), D3DX_SDK_VERSION).c_str());
if( !hDll ) if( !hDll )
{ {
msg = _T("Please make sure that you have the latest version of DirectX 9.0c correctly installed."); msg = _T("Please make sure that you have the latest version of DirectX correctly installed.");
return false; return false;
} else } else
msg = _T("DirectX9 is up to date and ready to be used!"); msg = _T("DirectX is up to date and ready to be used!");
FreeLibrary( hDll ); FreeLibrary( hDll );
return true; return true;
} }

View File

@ -274,10 +274,10 @@ struct TabEnhancements : public W32Util::Tab
{ {
void Init(HWND hDlg) void Init(HWND hDlg)
{ {
Button_SetCheck(GetDlgItem(hDlg,IDC_FORCEFILTERING),g_Config.bForceFiltering); Button_SetCheck(GetDlgItem(hDlg, IDC_FORCEFILTERING),g_Config.bForceFiltering);
Button_SetCheck(GetDlgItem(hDlg,IDC_FORCEANISOTROPY),g_Config.iMaxAnisotropy > 1); Button_SetCheck(GetDlgItem(hDlg, IDC_FORCEANISOTROPY),g_Config.iMaxAnisotropy > 1);
Button_SetCheck(GetDlgItem(hDlg, IDC_LOADHIRESTEXTURE), g_Config.bHiresTextures); Button_SetCheck(GetDlgItem(hDlg, IDC_LOADHIRESTEXTURE), g_Config.bHiresTextures);
Button_SetCheck(GetDlgItem(hDlg,IDC_EFBSCALEDCOPY), g_Config.bCopyEFBScaled); Button_SetCheck(GetDlgItem(hDlg, IDC_EFBSCALEDCOPY), g_Config.bCopyEFBScaled);
/* /*
Temporarily disabled the old postprocessing code since it wasn't working anyway. Temporarily disabled the old postprocessing code since it wasn't working anyway.
@ -299,7 +299,7 @@ struct TabEnhancements : public W32Util::Tab
ComboBox_SetCurSel(pp, g_Config.iPostprocessEffect); ComboBox_SetCurSel(pp, g_Config.iPostprocessEffect);
*/ */
} }
void Command(HWND hDlg,WPARAM wParam) void Command(HWND hDlg, WPARAM wParam)
{ {
/* /*
switch (LOWORD(wParam)) switch (LOWORD(wParam))
@ -314,7 +314,7 @@ struct TabEnhancements : public W32Util::Tab
g_Config.iMaxAnisotropy = Button_GetCheck(GetDlgItem(hDlg, IDC_FORCEANISOTROPY)) ? 8 : 1; g_Config.iMaxAnisotropy = Button_GetCheck(GetDlgItem(hDlg, IDC_FORCEANISOTROPY)) ? 8 : 1;
g_Config.bForceFiltering = Button_GetCheck(GetDlgItem(hDlg, IDC_FORCEFILTERING)) ? true : false; g_Config.bForceFiltering = Button_GetCheck(GetDlgItem(hDlg, IDC_FORCEFILTERING)) ? true : false;
g_Config.bHiresTextures = Button_GetCheck(GetDlgItem(hDlg, IDC_LOADHIRESTEXTURE)) ? true : false; g_Config.bHiresTextures = Button_GetCheck(GetDlgItem(hDlg, IDC_LOADHIRESTEXTURE)) ? true : false;
g_Config.bCopyEFBScaled = Button_GetCheck(GetDlgItem(hDlg,IDC_EFBSCALEDCOPY)) ? true : false; g_Config.bCopyEFBScaled = Button_GetCheck(GetDlgItem(hDlg, IDC_EFBSCALEDCOPY)) ? true : false;
g_Config.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str()); g_Config.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str());
} }
}; };
@ -333,12 +333,10 @@ void DlgSettings_Show(HINSTANCE hInstance, HWND _hParent)
#ifdef DEBUGFAST #ifdef DEBUGFAST
sheet.Show(hInstance,_hParent,_T("DX9 Graphics Plugin (DEBUGFAST)")); sheet.Show(hInstance,_hParent,_T("DX9 Graphics Plugin (DEBUGFAST)"));
#else #elif defined _DEBUG
#ifndef _DEBUG
sheet.Show(hInstance,_hParent,_T("DX9 Graphics Plugin"));
#else
sheet.Show(hInstance,_hParent,_T("DX9 Graphics Plugin (DEBUG)")); sheet.Show(hInstance,_hParent,_T("DX9 Graphics Plugin (DEBUG)"));
#endif #else
sheet.Show(hInstance,_hParent,_T("DX9 Graphics Plugin"));
#endif #endif
if ((tfoe != g_Config.bTexFmtOverlayEnable) || if ((tfoe != g_Config.bTexFmtOverlayEnable) ||

View File

@ -24,7 +24,7 @@
#include "TextureConverter.h" #include "TextureConverter.h"
#undef CHECK #undef CHECK
#define CHECK(hr,Message) if (FAILED(hr)) { PanicAlert(__FUNCTION__ " FAIL: %s" ,Message); } #define CHECK(hr, Message) if (FAILED(hr)) { PanicAlert(__FUNCTION__ " FAIL: %s" , Message); }
FramebufferManager FBManager; FramebufferManager FBManager;
@ -42,6 +42,7 @@ LPDIRECT3DSURFACE9 FramebufferManager::GetEFBColorOffScreenRTSurface()
{ {
return s_efb_color_OffScreenReadBuffer; return s_efb_color_OffScreenReadBuffer;
} }
LPDIRECT3DSURFACE9 FramebufferManager::GetEFBDepthOffScreenRTSurface() LPDIRECT3DSURFACE9 FramebufferManager::GetEFBDepthOffScreenRTSurface()
{ {
return s_efb_depth_OffScreenReadBuffer; return s_efb_depth_OffScreenReadBuffer;
@ -57,24 +58,31 @@ LPDIRECT3DSURFACE9 FramebufferManager::GetEFBDepthReadSurface()
return s_efb_depth_ReadBuffer; return s_efb_depth_ReadBuffer;
} }
D3DFORMAT FramebufferManager::GetEFBDepthRTSurfaceFormat(){return s_efb_depth_surface_Format;} D3DFORMAT FramebufferManager::GetEFBDepthRTSurfaceFormat()
D3DFORMAT FramebufferManager::GetEFBDepthReadSurfaceFormat(){return s_efb_depth_ReadBuffer_Format;} {
D3DFORMAT FramebufferManager::GetEFBColorRTSurfaceFormat(){return s_efb_color_surface_Format;} return s_efb_depth_surface_Format;
}
D3DFORMAT FramebufferManager::GetEFBDepthReadSurfaceFormat()
{
return s_efb_depth_ReadBuffer_Format;
}
D3DFORMAT FramebufferManager::GetEFBColorRTSurfaceFormat()
{
return s_efb_color_surface_Format;
}
LPDIRECT3DTEXTURE9 FramebufferManager::GetEFBColorTexture(const EFBRectangle& sourceRc) LPDIRECT3DTEXTURE9 FramebufferManager::GetEFBColorTexture(const EFBRectangle& sourceRc)
{ {
return s_efb_color_texture; return s_efb_color_texture;
} }
LPDIRECT3DTEXTURE9 FramebufferManager::GetEFBDepthTexture(const EFBRectangle &sourceRc) LPDIRECT3DTEXTURE9 FramebufferManager::GetEFBDepthTexture(const EFBRectangle &sourceRc)
{ {
return s_efb_depth_texture; return s_efb_depth_texture;
} }
void FramebufferManager::Create() void FramebufferManager::Create()
{ {
// Simplest possible setup to start with. // Simplest possible setup to start with.
@ -87,19 +95,19 @@ void FramebufferManager::Create()
D3DPOOL_DEFAULT, &s_efb_color_texture, NULL); D3DPOOL_DEFAULT, &s_efb_color_texture, NULL);
if(s_efb_color_texture) if(s_efb_color_texture)
{ {
hr = s_efb_color_texture->GetSurfaceLevel(0,&s_efb_color_surface); hr = s_efb_color_texture->GetSurfaceLevel(0, &s_efb_color_surface);
} }
CHECK(hr,"Create Color Texture"); CHECK(hr, "Create Color Texture");
hr = D3D::dev->CreateTexture(1, 1, 1, D3DUSAGE_RENDERTARGET, s_efb_color_surface_Format, hr = D3D::dev->CreateTexture(1, 1, 1, D3DUSAGE_RENDERTARGET, s_efb_color_surface_Format,
D3DPOOL_DEFAULT, &s_efb_colorRead_texture, NULL); D3DPOOL_DEFAULT, &s_efb_colorRead_texture, NULL);
CHECK(hr,"Create Color Read Texture"); CHECK(hr, "Create Color Read Texture");
if(s_efb_colorRead_texture) if(s_efb_colorRead_texture)
{ {
s_efb_colorRead_texture->GetSurfaceLevel(0,&s_efb_color_ReadBuffer); s_efb_colorRead_texture->GetSurfaceLevel(0, &s_efb_color_ReadBuffer);
} }
//create an offscreen surface that we can lock to retrieve the data //create an offscreen surface that we can lock to retrieve the data
hr = D3D::dev->CreateOffscreenPlainSurface(1, 1, s_efb_color_surface_Format, D3DPOOL_SYSTEMMEM, &s_efb_color_OffScreenReadBuffer, NULL ); hr = D3D::dev->CreateOffscreenPlainSurface(1, 1, s_efb_color_surface_Format, D3DPOOL_SYSTEMMEM, &s_efb_color_OffScreenReadBuffer, NULL);
CHECK(hr,"Create Color offScreen Surface"); CHECK(hr, "Create Color offScreen Surface");
//Select Zbuffer format supported by hadware. //Select Zbuffer format supported by hadware.
if (g_ActiveConfig.bEFBAccessEnable) if (g_ActiveConfig.bEFBAccessEnable)
@ -111,19 +119,20 @@ void FramebufferManager::Create()
DepthTexFormats[3] = FOURCC_DF16; DepthTexFormats[3] = FOURCC_DF16;
DepthTexFormats[4] = D3DFMT_D24X8; DepthTexFormats[4] = D3DFMT_D24X8;
for(int i = 0;i<5;i++) for(int i = 0; i < 5; i++)
{ {
s_efb_depth_surface_Format = DepthTexFormats[i]; s_efb_depth_surface_Format = DepthTexFormats[i];
//get the framebuffer Depth texture //get the framebuffer Depth texture
hr = D3D::dev->CreateTexture(target_width, target_height, 1, D3DUSAGE_DEPTHSTENCIL, s_efb_depth_surface_Format, hr = D3D::dev->CreateTexture(target_width, target_height, 1, D3DUSAGE_DEPTHSTENCIL, s_efb_depth_surface_Format,
D3DPOOL_DEFAULT, &s_efb_depth_texture, NULL); D3DPOOL_DEFAULT, &s_efb_depth_texture, NULL);
if (!FAILED(hr)) break; if (!FAILED(hr))
break;
} }
CHECK(hr,"Depth Color Texture"); CHECK(hr,"Depth Color Texture");
//get the Surface //get the Surface
if(s_efb_depth_texture) if(s_efb_depth_texture)
{ {
s_efb_depth_texture->GetSurfaceLevel(0,&s_efb_depth_surface); s_efb_depth_texture->GetSurfaceLevel(0, &s_efb_depth_surface);
} }
//create a 4x4 pixel texture to work as a buffer for peeking //create a 4x4 pixel texture to work as a buffer for peeking
if(s_efb_depth_surface_Format == FOURCC_RAWZ || s_efb_depth_surface_Format == D3DFMT_D24X8) if(s_efb_depth_surface_Format == FOURCC_RAWZ || s_efb_depth_surface_Format == D3DFMT_D24X8)
@ -136,23 +145,24 @@ void FramebufferManager::Create()
} }
DepthTexFormats[1] = D3DFMT_A8R8G8B8; DepthTexFormats[1] = D3DFMT_A8R8G8B8;
for(int i = 0;i<2;i++) for(int i = 0; i < 2; i++)
{ {
s_efb_depth_ReadBuffer_Format = DepthTexFormats[i]; s_efb_depth_ReadBuffer_Format = DepthTexFormats[i];
//get the framebuffer Depth texture //get the framebuffer Depth texture
hr = D3D::dev->CreateTexture(4, 4, 1, D3DUSAGE_RENDERTARGET, s_efb_depth_ReadBuffer_Format, hr = D3D::dev->CreateTexture(4, 4, 1, D3DUSAGE_RENDERTARGET, s_efb_depth_ReadBuffer_Format,
D3DPOOL_DEFAULT, &s_efb_depthRead_texture, NULL); D3DPOOL_DEFAULT, &s_efb_depthRead_texture, NULL);
if (!FAILED(hr)) break; if (!FAILED(hr))
break;
} }
CHECK(hr,"Create Depth Read texture"); CHECK(hr, "Create Depth Read texture");
if(s_efb_depthRead_texture) if(s_efb_depthRead_texture)
{ {
s_efb_depthRead_texture->GetSurfaceLevel(0,&s_efb_depth_ReadBuffer); s_efb_depthRead_texture->GetSurfaceLevel(0, &s_efb_depth_ReadBuffer);
} }
//create an offscreen surface that we can lock to retrieve the data //create an offscreen surface that we can lock to retrieve the data
hr = D3D::dev->CreateOffscreenPlainSurface(4, 4, s_efb_depth_ReadBuffer_Format, D3DPOOL_SYSTEMMEM, &s_efb_depth_OffScreenReadBuffer, NULL ); hr = D3D::dev->CreateOffscreenPlainSurface(4, 4, s_efb_depth_ReadBuffer_Format, D3DPOOL_SYSTEMMEM, &s_efb_depth_OffScreenReadBuffer, NULL);
CHECK(hr,"Create Depth offScreen Surface"); CHECK(hr, "Create Depth offScreen Surface");
delete [] DepthTexFormats; delete [] DepthTexFormats;
} }
else else
@ -160,7 +170,7 @@ void FramebufferManager::Create()
s_efb_depth_surface_Format = D3DFMT_D24X8; s_efb_depth_surface_Format = D3DFMT_D24X8;
hr = D3D::dev->CreateDepthStencilSurface(target_width, target_height, s_efb_depth_surface_Format, hr = D3D::dev->CreateDepthStencilSurface(target_width, target_height, s_efb_depth_surface_Format,
D3DMULTISAMPLE_NONE, 0, FALSE, &s_efb_depth_surface, NULL); D3DMULTISAMPLE_NONE, 0, FALSE, &s_efb_depth_surface, NULL);
CHECK(hr,"CreateDepthStencilSurface"); CHECK(hr, "CreateDepthStencilSurface");
} }
} }
@ -168,43 +178,43 @@ void FramebufferManager::Destroy()
{ {
if (s_efb_depth_surface) if (s_efb_depth_surface)
s_efb_depth_surface->Release(); s_efb_depth_surface->Release();
s_efb_depth_surface=NULL; s_efb_depth_surface = NULL;
if (s_efb_color_surface) if (s_efb_color_surface)
s_efb_color_surface->Release(); s_efb_color_surface->Release();
s_efb_color_surface=NULL; s_efb_color_surface = NULL;
if (s_efb_color_ReadBuffer) if (s_efb_color_ReadBuffer)
s_efb_color_ReadBuffer->Release(); s_efb_color_ReadBuffer->Release();
s_efb_color_ReadBuffer=NULL; s_efb_color_ReadBuffer = NULL;
if (s_efb_depth_ReadBuffer) if (s_efb_depth_ReadBuffer)
s_efb_depth_ReadBuffer->Release(); s_efb_depth_ReadBuffer->Release();
s_efb_depth_ReadBuffer=NULL; s_efb_depth_ReadBuffer = NULL;
if (s_efb_color_OffScreenReadBuffer) if (s_efb_color_OffScreenReadBuffer)
s_efb_color_OffScreenReadBuffer->Release(); s_efb_color_OffScreenReadBuffer->Release();
s_efb_color_OffScreenReadBuffer=NULL; s_efb_color_OffScreenReadBuffer = NULL;
if (s_efb_depth_OffScreenReadBuffer) if (s_efb_depth_OffScreenReadBuffer)
s_efb_depth_OffScreenReadBuffer->Release(); s_efb_depth_OffScreenReadBuffer->Release();
s_efb_depth_OffScreenReadBuffer=NULL; s_efb_depth_OffScreenReadBuffer = NULL;
if (s_efb_color_texture) if (s_efb_color_texture)
s_efb_color_texture->Release(); s_efb_color_texture->Release();
s_efb_color_texture=NULL; s_efb_color_texture = NULL;
if (s_efb_colorRead_texture) if (s_efb_colorRead_texture)
s_efb_colorRead_texture->Release(); s_efb_colorRead_texture->Release();
s_efb_colorRead_texture=NULL; s_efb_colorRead_texture = NULL;
if (s_efb_depth_texture) if (s_efb_depth_texture)
s_efb_depth_texture->Release(); s_efb_depth_texture->Release();
s_efb_depth_texture=NULL; s_efb_depth_texture = NULL;
if (s_efb_depthRead_texture) if (s_efb_depthRead_texture)
s_efb_depthRead_texture->Release(); s_efb_depthRead_texture->Release();
s_efb_depthRead_texture=NULL; s_efb_depthRead_texture = NULL;
for (VirtualXFBListType::iterator it = m_virtualXFBList.begin(); it != m_virtualXFBList.end(); ++it) for (VirtualXFBListType::iterator it = m_virtualXFBList.begin(); it != m_virtualXFBList.end(); ++it)
{ {
@ -403,7 +413,7 @@ void FramebufferManager::copyToVirtualXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight
Renderer::ResetAPIState(); // reset any game specific settings Renderer::ResetAPIState(); // reset any game specific settings
LPDIRECT3DSURFACE9 Rendersurf = NULL; LPDIRECT3DSURFACE9 Rendersurf = NULL;
xfbTexture->GetSurfaceLevel(0,&Rendersurf); xfbTexture->GetSurfaceLevel(0, &Rendersurf);
D3D::dev->SetDepthStencilSurface(NULL); D3D::dev->SetDepthStencilSurface(NULL);
D3D::dev->SetRenderTarget(0, Rendersurf); D3D::dev->SetRenderTarget(0, Rendersurf);
@ -425,11 +435,10 @@ void FramebufferManager::copyToVirtualXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight
D3D::ChangeSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); D3D::ChangeSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
D3D::ChangeSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); D3D::ChangeSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
D3D::drawShadedTexQuad( D3D::drawShadedTexQuad(
read_texture, read_texture,
&sourcerect, &sourcerect,
Renderer::GetFullTargetWidth() , Renderer::GetFullTargetWidth(),
Renderer::GetFullTargetHeight(), Renderer::GetFullTargetHeight(),
target_width, target_width,
target_height, target_height,
@ -439,12 +448,11 @@ void FramebufferManager::copyToVirtualXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight
D3D::RefreshSamplerState(0, D3DSAMP_MINFILTER); D3D::RefreshSamplerState(0, D3DSAMP_MINFILTER);
D3D::RefreshSamplerState(0, D3DSAMP_MAGFILTER); D3D::RefreshSamplerState(0, D3DSAMP_MAGFILTER);
D3D::SetTexture(0,NULL); D3D::SetTexture(0, NULL);
D3D::dev->SetRenderTarget(0, GetEFBColorRTSurface()); D3D::dev->SetRenderTarget(0, GetEFBColorRTSurface());
D3D::dev->SetDepthStencilSurface(GetEFBDepthRTSurface()); D3D::dev->SetDepthStencilSurface(GetEFBDepthRTSurface());
Renderer::RestoreAPIState(); Renderer::RestoreAPIState();
Rendersurf->Release(); Rendersurf->Release();
} }
const XFBSource** FramebufferManager::getRealXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, u32 &xfbCount) const XFBSource** FramebufferManager::getRealXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, u32 &xfbCount)

View File

@ -163,7 +163,6 @@ private:
LPDIRECT3DSURFACE9 s_efb_color_OffScreenReadBuffer;//System memory Surface that can be locked to retriebe the data LPDIRECT3DSURFACE9 s_efb_color_OffScreenReadBuffer;//System memory Surface that can be locked to retriebe the data
LPDIRECT3DSURFACE9 s_efb_depth_OffScreenReadBuffer;//System memory Surface that can be locked to retriebe the data LPDIRECT3DSURFACE9 s_efb_depth_OffScreenReadBuffer;//System memory Surface that can be locked to retriebe the data
D3DFORMAT s_efb_color_surface_Format;//Format of the color Surface D3DFORMAT s_efb_color_surface_Format;//Format of the color Surface
D3DFORMAT s_efb_depth_surface_Format;//Format of the Depth Surface D3DFORMAT s_efb_depth_surface_Format;//Format of the Depth Surface
D3DFORMAT s_efb_depth_ReadBuffer_Format;//Format of the Depth color Read Surface D3DFORMAT s_efb_depth_ReadBuffer_Format;//Format of the Depth color Read Surface

View File

@ -116,7 +116,7 @@ static const D3DBLEND d3dDestFactors[8] =
D3DBLEND_INVDESTALPHA D3DBLEND_INVDESTALPHA
}; };
static const D3DBLENDOP d3dLogincOPop[16] = static const D3DBLENDOP d3dLogicOpop[16] =
{ {
D3DBLENDOP_ADD, D3DBLENDOP_ADD,
D3DBLENDOP_ADD, D3DBLENDOP_ADD,
@ -239,7 +239,6 @@ void TeardownDeviceObjects()
FBManager.Destroy(); FBManager.Destroy();
D3D::font.Shutdown(); D3D::font.Shutdown();
TextureCache::Invalidate(false); TextureCache::Invalidate(false);
VertexManager::DestroyDeviceObjects();
VertexLoaderManager::Shutdown(); VertexLoaderManager::Shutdown();
VertexShaderCache::Clear(); VertexShaderCache::Clear();
PixelShaderCache::Clear(); PixelShaderCache::Clear();
@ -1248,10 +1247,10 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
void Renderer::ResetAPIState() void Renderer::ResetAPIState()
{ {
D3D::SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE); D3D::SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE);
D3D::SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE); D3D::SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW);
D3D::SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); D3D::SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
D3D::SetRenderState(D3DRS_ZENABLE, FALSE); D3D::SetRenderState(D3DRS_ZENABLE, FALSE);
D3D::SetRenderState(D3DRS_ZWRITEENABLE, FALSE); D3D::SetRenderState(D3DRS_ZWRITEENABLE, TRUE);
DWORD color_mask = D3DCOLORWRITEENABLE_ALPHA| D3DCOLORWRITEENABLE_RED | D3DCOLORWRITEENABLE_GREEN | D3DCOLORWRITEENABLE_BLUE; DWORD color_mask = D3DCOLORWRITEENABLE_ALPHA| D3DCOLORWRITEENABLE_RED | D3DCOLORWRITEENABLE_GREEN | D3DCOLORWRITEENABLE_BLUE;
D3D::SetRenderState(D3DRS_COLORWRITEENABLE, color_mask); D3D::SetRenderState(D3DRS_COLORWRITEENABLE, color_mask);
} }
@ -1294,7 +1293,7 @@ void Renderer::SetLogicOpMode()
{ {
s_blendMode = 0; s_blendMode = 0;
D3D::SetRenderState(D3DRS_ALPHABLENDENABLE, 1); D3D::SetRenderState(D3DRS_ALPHABLENDENABLE, 1);
D3D::SetRenderState(D3DRS_BLENDOP, d3dLogincOPop[bpmem.blendmode.logicmode]); D3D::SetRenderState(D3DRS_BLENDOP, d3dLogicOpop[bpmem.blendmode.logicmode]);
D3D::SetRenderState(D3DRS_SRCBLEND, d3dLogicOpSrcFactors[bpmem.blendmode.logicmode]); D3D::SetRenderState(D3DRS_SRCBLEND, d3dLogicOpSrcFactors[bpmem.blendmode.logicmode]);
D3D::SetRenderState(D3DRS_DESTBLEND, d3dLogicOpDestFactors[bpmem.blendmode.logicmode]); D3D::SetRenderState(D3DRS_DESTBLEND, d3dLogicOpDestFactors[bpmem.blendmode.logicmode]);
} }

View File

@ -583,3 +583,4 @@ void TextureCache::CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, boo
Renderer::RestoreAPIState(); Renderer::RestoreAPIState();
Rendersurf->Release(); Rendersurf->Release();
} }

View File

@ -58,9 +58,6 @@ static u16 *PIBuffer;
#define MAXIBUFFERSIZE 0xFFFF #define MAXIBUFFERSIZE 0xFFFF
static bool Flushed=false; static bool Flushed=false;
void CreateDeviceObjects();
void DestroyDeviceObjects();
bool Init() bool Init()
{ {
LocalVBuffer = new u8[MAXVBUFFERSIZE]; LocalVBuffer = new u8[MAXVBUFFERSIZE];
@ -80,7 +77,6 @@ void ResetBuffer()
void Shutdown() void Shutdown()
{ {
DestroyDeviceObjects();
delete [] LocalVBuffer; delete [] LocalVBuffer;
delete [] TIBuffer; delete [] TIBuffer;
delete [] LIBuffer; delete [] LIBuffer;
@ -88,15 +84,6 @@ void Shutdown()
ResetBuffer(); ResetBuffer();
} }
void CreateDeviceObjects()
{
}
void DestroyDeviceObjects()
{
}
void AddIndices(int _primitive, int _numVertices) void AddIndices(int _primitive, int _numVertices)
{ {
switch (_primitive) switch (_primitive)

View File

@ -30,9 +30,6 @@ void Shutdown();
void AddVertices(int _primitive, int _numVertices); void AddVertices(int _primitive, int _numVertices);
void Flush(); void Flush();
void CreateDeviceObjects();
void DestroyDeviceObjects();
} // namespace } // namespace
#endif #endif

View File

@ -553,7 +553,6 @@ TargetRectangle Renderer::ConvertEFBRectangle(const EFBRectangle& rc)
} }
void Renderer::ResetAPIState() void Renderer::ResetAPIState()
{ {
// Gets us to a reasonably sane state where it's possible to do things like // Gets us to a reasonably sane state where it's possible to do things like
@ -966,7 +965,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
glTexCoord2f(sourceRc.right, sourceRc.top); glMultiTexCoord2fARB(GL_TEXTURE1, 1, 1); glVertex2f(drawRc.right, drawRc.top); glTexCoord2f(sourceRc.right, sourceRc.top); glMultiTexCoord2fARB(GL_TEXTURE1, 1, 1); glVertex2f(drawRc.right, drawRc.top);
glTexCoord2f(sourceRc.right, sourceRc.bottom); glMultiTexCoord2fARB(GL_TEXTURE1, 1, 0); glVertex2f(drawRc.right, drawRc.bottom); glTexCoord2f(sourceRc.right, sourceRc.bottom); glMultiTexCoord2fARB(GL_TEXTURE1, 1, 0); glVertex2f(drawRc.right, drawRc.bottom);
glEnd(); glEnd();
PixelShaderCache::DisableShader();; PixelShaderCache::DisableShader();
} }
else else
{ {

View File

@ -702,7 +702,7 @@ int WiimotePairUp(bool unpair)
//btdi.szName is sometimes missings it's content - it's a bt feature.. //btdi.szName is sometimes missings it's content - it's a bt feature..
if ((!wcscmp(btdi.szName, L"Nintendo RVL-WBC-01") || !wcscmp(btdi.szName, L"Nintendo RVL-CNT-01")) && !btdi.fConnected && !unpair) if ((!wcscmp(btdi.szName, L"Nintendo RVL-WBC-01") || !wcscmp(btdi.szName, L"Nintendo RVL-CNT-01")) && !btdi.fConnected && !unpair)
{ {
//TODO: improve the readd of the BT driver, esp. when batteries of the wiimote are removed while beeing fConnected //TODO: improve the read of the BT driver, esp. when batteries of the wiimote are removed while being fConnected
if (btdi.fRemembered) if (btdi.fRemembered)
{ {
// Make Windows forget old expired pairing // Make Windows forget old expired pairing