Calibrated emulated Wiimote aiming in widescreen mode. Added config menu to Wiimote. Added hide cursor option to OpenGL plugin. Added custom Wii settings and moved SYSCONF to User/Config (it will be copied by the game to Wii/shared2/sys when a game is run). Made the DSP and Video debugging windowses run on the same dll instance as the main instance.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1188 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson 2008-11-16 20:09:13 +00:00
parent ecf6825a97
commit be6a6215c9
39 changed files with 756 additions and 116 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="9.00" Version="9,00"
Name="Common" Name="Common"
ProjectGUID="{C573CAF7-EE6A-458E-8049-16C0BF34C2E9}" ProjectGUID="{C573CAF7-EE6A-458E-8049-16C0BF34C2E9}"
RootNamespace="Common" RootNamespace="Common"
@ -267,7 +267,7 @@
Optimization="2" Optimization="2"
EnableIntrinsicFunctions="true" EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="../../PluginSpecs" AdditionalIncludeDirectories="../../PluginSpecs;..\Core\Src"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true" StringPooling="true"
RuntimeLibrary="0" RuntimeLibrary="0"

View File

@ -56,26 +56,32 @@ std::string GetLastErrorAsString()
} }
#endif #endif
bool DynamicLibrary::Load(const char* filename) // ------------------------------------------------------------------
/* Loading means loading the dll with LoadLibrary() to get an instance to the dll.
This is done when Dolphin is started to determine which dlls are good, and
before opening the Config and Debugging windowses from Plugin.cpp and
before opening the dll for running the emulation in Video_...cpp in Core. */
// -----------------------
int DynamicLibrary::Load(const char* filename)
{ {
if (!filename || strlen(filename) == 0) if (!filename || strlen(filename) == 0)
{ {
LOG(MASTER_LOG, "Missing filename of dynamic library to load"); LOG(MASTER_LOG, "Missing filename of dynamic library to load");
return false; return 0;
} }
LOG(MASTER_LOG, "Trying to load library %s", filename); LOG(MASTER_LOG, "Trying to load library %s", filename);
if (IsLoaded()) if (IsLoaded())
{ {
LOG(MASTER_LOG, "Trying to load already loaded library %s", filename); LOG(MASTER_LOG, "Trying to load already loaded library %s", filename);
return false; return 2;
} }
#ifdef _WIN32 #ifdef _WIN32
library = LoadLibrary(filename); library = LoadLibrary(filename);
if (!library) { if (!library) {
LOG(MASTER_LOG, "Error loading DLL %s: %s", filename, GetLastErrorAsString().c_str()); LOG(MASTER_LOG, "Error loading DLL %s: %s", filename, GetLastErrorAsString().c_str());
return false; return 0;
} }
#else #else
library = dlopen(filename, RTLD_NOW | RTLD_LOCAL); library = dlopen(filename, RTLD_NOW | RTLD_LOCAL);
@ -90,7 +96,7 @@ bool DynamicLibrary::Load(const char* filename)
} }
#endif #endif
library_file = filename; library_file = filename;
return true; return 1;
} }

View File

@ -29,14 +29,12 @@ class DynamicLibrary
public: public:
DynamicLibrary(); DynamicLibrary();
bool Load(const char* filename); int Load(const char* filename);
void Unload(); void Unload();
void* Get(const char* funcname) const; void* Get(const char* funcname) const;
bool IsLoaded() const {return(library != 0);} bool IsLoaded() const {return(library != 0);}
private: private:
std::string library_file; std::string library_file;
#ifdef _WIN32 #ifdef _WIN32

View File

@ -15,6 +15,16 @@
// Official SVN repository and contact information can be found at // Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/ // http://code.google.com/p/dolphin-emu/
// =======================================================
// File description
// -------------
/* This file is a simpler version of Plugin_...cpp found in Core. This file only loads
the config and debugging windowses and works with all plugins. */
// =============
#include "Plugin.h" #include "Plugin.h"
namespace Common namespace Common
@ -24,7 +34,7 @@ DynamicLibrary CPlugin::m_hInstLib;
void(__cdecl * CPlugin::m_GetDllInfo) (PLUGIN_INFO * _PluginInfo) = 0; void(__cdecl * CPlugin::m_GetDllInfo) (PLUGIN_INFO * _PluginInfo) = 0;
//void(__cdecl * CPlugin::m_DllAbout) (HWND _hParent) = 0; //void(__cdecl * CPlugin::m_DllAbout) (HWND _hParent) = 0;
void(__cdecl * CPlugin::m_DllConfig) (HWND _hParent) = 0; void(__cdecl * CPlugin::m_DllConfig) (HWND _hParent) = 0;
void(__cdecl * CPlugin::m_DllDebugger) (HWND _hParent) = 0; void(__cdecl * CPlugin::m_DllDebugger) (HWND _hParent, bool Show) = 0;
void void
CPlugin::Release(void) CPlugin::Release(void)
@ -42,9 +52,9 @@ CPlugin::Load(const char* _szName)
{ {
if (m_hInstLib.Load(_szName)) if (m_hInstLib.Load(_szName))
{ {
m_GetDllInfo = (void (__cdecl*)(PLUGIN_INFO*))m_hInstLib.Get("GetDllInfo"); m_GetDllInfo = (void (__cdecl*)(PLUGIN_INFO*)) m_hInstLib.Get("GetDllInfo");
m_DllConfig = (void (__cdecl*)(HWND))m_hInstLib.Get("DllConfig"); m_DllConfig = (void (__cdecl*)(HWND)) m_hInstLib.Get("DllConfig");
m_DllDebugger = (void (__cdecl*)(HWND))m_hInstLib.Get("DllDebugger"); m_DllDebugger = (void (__cdecl*)(HWND, bool)) m_hInstLib.Get("DllDebugger");
return(true); return(true);
} }
@ -80,11 +90,11 @@ void CPlugin::Config(HWND _hwnd)
// } // }
//} //}
void CPlugin::Debug(HWND _hwnd) void CPlugin::Debug(HWND _hwnd, bool Show)
{ {
if (m_DllDebugger != 0) if (m_DllDebugger != 0)
{ {
m_DllDebugger(_hwnd); m_DllDebugger(_hwnd, Show);
} }
} }
} // end of namespace Common } // end of namespace Common

View File

@ -35,7 +35,7 @@ class CPlugin
static void Config(HWND _hwnd); static void Config(HWND _hwnd);
static void About(HWND _hwnd); static void About(HWND _hwnd);
static void Debug(HWND _hwnd); static void Debug(HWND _hwnd, bool Show);
private: private:
@ -44,7 +44,7 @@ class CPlugin
static void (__cdecl * m_GetDllInfo)(PLUGIN_INFO* _PluginInfo); static void (__cdecl * m_GetDllInfo)(PLUGIN_INFO* _PluginInfo);
static void (__cdecl * m_DllConfig)(HWND _hParent); static void (__cdecl * m_DllConfig)(HWND _hParent);
static void (__cdecl * m_DllDebugger)(HWND _hParent); static void (__cdecl * m_DllDebugger)(HWND _hParent, bool Show);
}; };
} // end of namespace Common } // end of namespace Common

View File

@ -152,6 +152,7 @@ bool Init(const SCoreStartupParameter _CoreParameter)
DisplayMessage("CPU: " + cpu_info.Summarize(), 8000); DisplayMessage("CPU: " + cpu_info.Summarize(), 8000);
DisplayMessage(_CoreParameter.m_strFilename, 3000); DisplayMessage(_CoreParameter.m_strFilename, 3000);
//PluginVideo::DllDebugger(NULL);
//RegisterPanicAlertHandler(PanicAlertToVideo); //RegisterPanicAlertHandler(PanicAlertToVideo);

View File

@ -15,6 +15,7 @@
// Official SVN repository and contact information can be found at // Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/ // http://code.google.com/p/dolphin-emu/
#include "Common.h"
#include "DynamicLibrary.h" #include "DynamicLibrary.h"
#include "Plugin_DSP.h" #include "Plugin_DSP.h"
@ -45,6 +46,11 @@ bool IsLoaded()
return plugin.IsLoaded(); return plugin.IsLoaded();
} }
void Debug(HWND _hwnd, bool Show)
{
DllDebugger(_hwnd, Show);
}
void UnloadPlugin() void UnloadPlugin()
{ {
plugin.Unload(); plugin.Unload();
@ -68,7 +74,9 @@ void UnloadPlugin()
bool LoadPlugin(const char *_Filename) bool LoadPlugin(const char *_Filename)
{ {
if (plugin.Load(_Filename)) int ret = plugin.Load(_Filename); // we may have alredy loaded this to open the debugger
if (ret == 1)
{ {
GetDllInfo = reinterpret_cast<TGetDllInfo> (plugin.Get("GetDllInfo")); GetDllInfo = reinterpret_cast<TGetDllInfo> (plugin.Get("GetDllInfo"));
DllConfig = reinterpret_cast<TDllConfig> (plugin.Get("DllConfig")); DllConfig = reinterpret_cast<TDllConfig> (plugin.Get("DllConfig"));
@ -98,6 +106,7 @@ bool LoadPlugin(const char *_Filename)
(DSP_SendAIBuffer != 0) && (DSP_SendAIBuffer != 0) &&
(DSP_DoState != 0)) (DSP_DoState != 0))
{ {
//PanicAlert("return true: %i", ret);
return true; return true;
} }
else else
@ -106,7 +115,12 @@ bool LoadPlugin(const char *_Filename)
return false; return false;
} }
} }
else if (ret == 2)
{
//PanicAlert("return true: %i", ret);
return true;
}
else if (ret == 0)
return false; return false;
} }

View File

@ -30,7 +30,7 @@ void UnloadPlugin();
typedef void (__cdecl* TGetDllInfo)(PLUGIN_INFO*); typedef void (__cdecl* TGetDllInfo)(PLUGIN_INFO*);
//typedef void (__cdecl* TDllAbout)(HWND); //typedef void (__cdecl* TDllAbout)(HWND);
typedef void (__cdecl* TDllConfig)(HWND); typedef void (__cdecl* TDllConfig)(HWND);
typedef void (__cdecl* TDllDebugger)(HWND); typedef void (__cdecl* TDllDebugger)(HWND, bool);
typedef void (__cdecl* TDSP_Initialize)(DSPInitialize); typedef void (__cdecl* TDSP_Initialize)(DSPInitialize);
typedef void (__cdecl* TDSP_Shutdown)(); typedef void (__cdecl* TDSP_Shutdown)();
typedef void (__cdecl* TDSP_WriteMailBox)(BOOL _CPUMailbox, unsigned short); typedef void (__cdecl* TDSP_WriteMailBox)(BOOL _CPUMailbox, unsigned short);

View File

@ -18,6 +18,9 @@
#include "Common.h" #include "Common.h"
#include "DynamicLibrary.h" #include "DynamicLibrary.h"
#include "Plugin_Video.h" #include "Plugin_Video.h"
#include "Plugin.h"
extern DynamicLibrary Common::CPlugin;
namespace PluginVideo namespace PluginVideo
{ {
@ -40,6 +43,11 @@ TVideo_Stop Video_Stop = 0;
// Library Instance // Library Instance
DynamicLibrary plugin; DynamicLibrary plugin;
void Debug(HWND _hwnd, bool Show)
{
DllDebugger(_hwnd, Show);
}
bool IsLoaded() bool IsLoaded()
{ {
return plugin.IsLoaded(); return plugin.IsLoaded();
@ -47,6 +55,8 @@ bool IsLoaded()
void UnloadPlugin() void UnloadPlugin()
{ {
//PanicAlert("Video UnloadPlugin");
// set Functions to 0 // set Functions to 0
GetDllInfo = 0; GetDllInfo = 0;
DllConfig = 0; DllConfig = 0;
@ -65,7 +75,9 @@ void UnloadPlugin()
bool LoadPlugin(const char *_Filename) bool LoadPlugin(const char *_Filename)
{ {
if (plugin.Load(_Filename)) int ret = plugin.Load(_Filename);
if (ret == 1)
{ {
GetDllInfo = reinterpret_cast<TGetDllInfo> (plugin.Get("GetDllInfo")); GetDllInfo = reinterpret_cast<TGetDllInfo> (plugin.Get("GetDllInfo"));
DllConfig = reinterpret_cast<TDllConfig> (plugin.Get("DllConfig")); DllConfig = reinterpret_cast<TDllConfig> (plugin.Get("DllConfig"));
@ -83,6 +95,7 @@ bool LoadPlugin(const char *_Filename)
if ((GetDllInfo != 0) && if ((GetDllInfo != 0) &&
//(DllAbout != 0) && //(DllAbout != 0) &&
(DllConfig != 0) && (DllConfig != 0) &&
(DllDebugger != 0) &&
(Video_Initialize != 0) && (Video_Initialize != 0) &&
(Video_Prepare != 0) && (Video_Prepare != 0) &&
(Video_Shutdown != 0) && (Video_Shutdown != 0) &&
@ -94,6 +107,7 @@ bool LoadPlugin(const char *_Filename)
(Video_DoState != 0) && (Video_DoState != 0) &&
(Video_Stop != 0)) (Video_Stop != 0))
{ {
//PanicAlert("return true: %i", ret);
return true; return true;
} }
else else
@ -102,7 +116,16 @@ bool LoadPlugin(const char *_Filename)
return false; return false;
} }
} }
else if(ret == 2)
{
//PanicAlert("return true: %i", ret);
return true;
}
else if(ret == 0)
{
//PanicAlert("return false: %i", ret);
return false; return false;
}
} }

View File

@ -34,7 +34,7 @@ void UnloadPlugin();
typedef void (__cdecl* TGetDllInfo)(PLUGIN_INFO*); typedef void (__cdecl* TGetDllInfo)(PLUGIN_INFO*);
//typedef void (__cdecl* TDllAbout)(HWND); //typedef void (__cdecl* TDllAbout)(HWND);
typedef void (__cdecl* TDllConfig)(HWND); typedef void (__cdecl* TDllConfig)(HWND);
typedef void (__cdecl* TDllDebugger)(HWND); typedef void (__cdecl* TDllDebugger)(HWND, bool);
typedef void (__cdecl* TVideo_Initialize)(SVideoInitialize*); typedef void (__cdecl* TVideo_Initialize)(SVideoInitialize*);
typedef void (__cdecl* TVideo_Prepare)(); typedef void (__cdecl* TVideo_Prepare)();
typedef void (__cdecl* TVideo_Shutdown)(); typedef void (__cdecl* TVideo_Shutdown)();

View File

@ -64,6 +64,8 @@
// and here are the classes // and here are the classes
class CPluginInfo; class CPluginInfo;
class CPluginManager; class CPluginManager;
//extern DynamicLibrary Common::CPlugin;
//extern CPluginManager CPluginManager::m_Instance;
extern "C" { extern "C" {
#include "../resources/toolbar_play.c" #include "../resources/toolbar_play.c"
@ -300,16 +302,21 @@ void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStart
// possible todo: add some kind of if here to? can it fail? // possible todo: add some kind of if here to? can it fail?
CPluginManager::GetInstance().OpenDebug( CPluginManager::GetInstance().OpenDebug(
GetHandle(), GetHandle(),
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str() SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(),
false, true
); );
} // don't have any else, just ignore it } // don't have any else, just ignore it
if(bVideoWindow) if(bVideoWindow)
{ {
wxMessageBox(_T("Warning, automatically opening this window before a game is started \n\
may cause a crash. Todo: figure out why and fix it."), wxT("OpenGL Debugging Window"));
// possible todo: add some kind of if here to? can it fail? // possible todo: add some kind of if here to? can it fail?
CPluginManager::GetInstance().OpenDebug( CPluginManager::GetInstance().OpenDebug(
GetHandle(), GetHandle(),
_LocalCoreStartupParameter.m_strVideoPlugin.c_str() _LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
true, true
); );
} // don't have any else, just ignore it } // don't have any else, just ignore it
} }
@ -940,12 +947,18 @@ void CCodeWindow::OnToggleSoundWindow(wxCommandEvent& event)
// TODO: add some kind of if() check here to? // TODO: add some kind of if() check here to?
CPluginManager::GetInstance().OpenDebug( CPluginManager::GetInstance().OpenDebug(
GetHandle(), GetHandle(),
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str() SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(),
false, true // DSP, show
); );
} }
else // hide else // hide
{ {
// can we close the dll window from here? // Close the sound dll that has an open debugger
CPluginManager::GetInstance().OpenDebug(
GetHandle(),
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(),
false, false // DSP, hide
);
} }
} }
// =========== // ===========
@ -968,12 +981,18 @@ void CCodeWindow::OnToggleVideoWindow(wxCommandEvent& event)
// TODO: add some kind of if() check here to? // TODO: add some kind of if() check here to?
CPluginManager::GetInstance().OpenDebug( CPluginManager::GetInstance().OpenDebug(
GetHandle(), GetHandle(),
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str() SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
true, true // Video, show
); );
} }
else // hide else // hide
{ {
// can we close the dll window from here? // Close the video dll that has an open debugger
CPluginManager::GetInstance().OpenDebug(
GetHandle(),
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
true, false // Video, hide
);
} }
} }
// =========== // ===========

View File

@ -26,6 +26,7 @@
#include "Volume.h" #include "Volume.h"
#include "VolumeCreator.h" #include "VolumeCreator.h"
#include "Config.h" #include "Config.h"
#include "ConfigMain.h"
#include "Core.h" #include "Core.h"
#if !defined(OSX64) #if !defined(OSX64)
#include "Frame.h" #include "Frame.h"
@ -89,9 +90,61 @@ bool BootCore(const std::string& _rFilename)
std::string unique_id = StartUp.GetUniqueID(); std::string unique_id = StartUp.GetUniqueID();
if (unique_id.size() == 6 && ini.Load((FULL_GAMECONFIG_DIR + unique_id + ".ini").c_str())) if (unique_id.size() == 6 && ini.Load((FULL_GAMECONFIG_DIR + unique_id + ".ini").c_str()))
{ {
// ------------------------------------------------
// General settings
// ----------------
ini.Get("Core", "UseDualCore", &StartUp.bUseDualCore, StartUp.bUseDualCore); ini.Get("Core", "UseDualCore", &StartUp.bUseDualCore, StartUp.bUseDualCore);
ini.Get("Core", "SkipIdle", &StartUp.bSkipIdle, StartUp.bSkipIdle); ini.Get("Core", "SkipIdle", &StartUp.bSkipIdle, StartUp.bSkipIdle);
ini.Get("Core", "OptimizeQuantizers", &StartUp.bOptimizeQuantizers, StartUp.bOptimizeQuantizers); ini.Get("Core", "OptimizeQuantizers", &StartUp.bOptimizeQuantizers, StartUp.bOptimizeQuantizers);
// ------------------------------------------------
// Read SYSCONF settings
// ----------------
bool bEnableProgressiveScan, bEnableWideScreen;
//bRefreshList = false;
FILE* pStream; // file handle
u8 m_SYSCONF[0x4000]; // SYSCONF file
u16 IPL_PGS = 0x17CC; // pregressive scan
u16 IPL_AR = 0x04D9; // widescreen
// Load Wii SYSCONF
pStream = NULL;
pStream = fopen(FULL_CONFIG_DIR "SYSCONF", "rb");
if (pStream != NULL)
{
fread(m_SYSCONF, 1, 0x4000, pStream);
fclose(pStream);
//wxMessageBox(wxString::Format(": %02x", m_SYSCONF[IPL_AR]));
ini.Get("Core", "EnableProgressiveScan", &bEnableProgressiveScan, (int)m_SYSCONF[IPL_PGS]);
ini.Get("Core", "EnableWideScreen", &bEnableWideScreen, (int)m_SYSCONF[IPL_AR]);
m_SYSCONF[IPL_PGS] = bEnableProgressiveScan;
m_SYSCONF[IPL_AR] = bEnableWideScreen;
//wxMessageBox(wxString::Format(": %02x", m_SYSCONF[IPL_AR]));
// Enable custom Wii SYSCONF settings by saving the file to shared2
pStream = NULL;
pStream = fopen(FULL_WII_USER_DIR "shared2/sys/SYSCONF", "wb");
if (pStream != NULL)
{
fwrite(m_SYSCONF, 1, 0x4000, pStream);
fclose(pStream);
}
else
{
PanicAlert("Could not write to shared2/sys/SYSCONF");
}
}
else
{
PanicAlert("Could not write to SYSCONF");
}
// ----------------
} }
#if !defined(OSX64) #if !defined(OSX64)
if(main_frame) if(main_frame)

View File

@ -64,7 +64,7 @@ CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title,
// Load Wii SYSCONF // Load Wii SYSCONF
pStream = NULL; pStream = NULL;
pStream = fopen(FULL_WII_USER_DIR "shared2/sys/SYSCONF", "rb"); pStream = fopen(FULL_CONFIG_DIR "SYSCONF", "rb");
if (pStream != NULL) if (pStream != NULL)
{ {
fread(m_SYSCONF, 1, 0x4000, pStream); fread(m_SYSCONF, 1, 0x4000, pStream);
@ -301,8 +301,19 @@ void CConfigMain::OnClose(wxCloseEvent& WXUNUSED (event))
{ {
Destroy(); Destroy();
// Save Wii SYSCONF // Save Wii SYSCONF twice so that we can keep game specific settings for it
pStream = NULL; pStream = NULL;
pStream = fopen(FULL_CONFIG_DIR "SYSCONF", "wb");
if (pStream != NULL)
{
fwrite(m_SYSCONF, 1, 0x4000, pStream);
fclose(pStream);
}
else
{
PanicAlert("Could not write to SYSCONF");
}
pStream = fopen(FULL_WII_USER_DIR "shared2/sys/SYSCONF", "wb"); pStream = fopen(FULL_WII_USER_DIR "shared2/sys/SYSCONF", "wb");
if (pStream != NULL) if (pStream != NULL)
{ {
@ -311,7 +322,7 @@ void CConfigMain::OnClose(wxCloseEvent& WXUNUSED (event))
} }
else else
{ {
PanicAlert("Could not write to Wii SYSCONF"); PanicAlert("Could not write to shared2/sys/SYSCONF");
} }
// save the config... dolphin crashes by far to often to save the settings on closing only // save the config... dolphin crashes by far to often to save the settings on closing only

View File

@ -93,6 +93,7 @@ EVT_MENU(IDM_CONFIG_MAIN, CFrame::OnConfigMain)
EVT_MENU(IDM_CONFIG_GFX_PLUGIN, CFrame::OnPluginGFX) EVT_MENU(IDM_CONFIG_GFX_PLUGIN, CFrame::OnPluginGFX)
EVT_MENU(IDM_CONFIG_DSP_PLUGIN, CFrame::OnPluginDSP) EVT_MENU(IDM_CONFIG_DSP_PLUGIN, CFrame::OnPluginDSP)
EVT_MENU(IDM_CONFIG_PAD_PLUGIN, CFrame::OnPluginPAD) EVT_MENU(IDM_CONFIG_PAD_PLUGIN, CFrame::OnPluginPAD)
EVT_MENU(IDM_CONFIG_WIIMOTE_PLUGIN, CFrame::OnPluginWiimote)
EVT_MENU(IDM_BROWSE, CFrame::OnBrowse) EVT_MENU(IDM_BROWSE, CFrame::OnBrowse)
EVT_MENU(IDM_MEMCARD, CFrame::OnMemcard) EVT_MENU(IDM_MEMCARD, CFrame::OnMemcard)
EVT_MENU(IDM_TOGGLE_FULLSCREEN, CFrame::OnToggleFullscreen) EVT_MENU(IDM_TOGGLE_FULLSCREEN, CFrame::OnToggleFullscreen)
@ -289,6 +290,7 @@ void CFrame::PopulateToolbar(wxToolBar* toolBar)
toolBar->AddTool(IDM_CONFIG_GFX_PLUGIN, _T("GFX"), m_Bitmaps[Toolbar_PluginGFX], _T("GFX settings")); toolBar->AddTool(IDM_CONFIG_GFX_PLUGIN, _T("GFX"), m_Bitmaps[Toolbar_PluginGFX], _T("GFX settings"));
toolBar->AddTool(IDM_CONFIG_DSP_PLUGIN, _T("DSP"), m_Bitmaps[Toolbar_PluginDSP], _T("DSP settings")); toolBar->AddTool(IDM_CONFIG_DSP_PLUGIN, _T("DSP"), m_Bitmaps[Toolbar_PluginDSP], _T("DSP settings"));
toolBar->AddTool(IDM_CONFIG_PAD_PLUGIN, _T("PAD"), m_Bitmaps[Toolbar_PluginPAD], _T("PAD settings")); toolBar->AddTool(IDM_CONFIG_PAD_PLUGIN, _T("PAD"), m_Bitmaps[Toolbar_PluginPAD], _T("PAD settings"));
toolBar->AddTool(IDM_CONFIG_WIIMOTE_PLUGIN, _T("Wiimote"), m_Bitmaps[Toolbar_PluginPAD], _T("Wiimote settings"));
toolBar->AddSeparator(); toolBar->AddSeparator();
toolBar->AddTool(IDM_HELPABOUT, _T("About"), m_Bitmaps[Toolbar_Help], _T("About Dolphin")); toolBar->AddTool(IDM_HELPABOUT, _T("About"), m_Bitmaps[Toolbar_Help], _T("About Dolphin"));
@ -480,7 +482,6 @@ void CFrame::OnPluginDSP(wxCommandEvent& WXUNUSED (event))
); );
} }
void CFrame::OnPluginPAD(wxCommandEvent& WXUNUSED (event)) void CFrame::OnPluginPAD(wxCommandEvent& WXUNUSED (event))
{ {
CPluginManager::GetInstance().OpenConfig( CPluginManager::GetInstance().OpenConfig(
@ -488,7 +489,7 @@ void CFrame::OnPluginPAD(wxCommandEvent& WXUNUSED (event))
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin.c_str() SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin.c_str()
); );
} }
void CFrame::OnPluginWiiMote(wxCommandEvent& WXUNUSED (event)) void CFrame::OnPluginWiimote(wxCommandEvent& WXUNUSED (event))
{ {
CPluginManager::GetInstance().OpenConfig( CPluginManager::GetInstance().OpenConfig(
GetHandle(), GetHandle(),

View File

@ -64,7 +64,7 @@ class CFrame : public wxFrame
void OnPluginGFX(wxCommandEvent& event); void OnPluginGFX(wxCommandEvent& event);
void OnPluginDSP(wxCommandEvent& event); void OnPluginDSP(wxCommandEvent& event);
void OnPluginPAD(wxCommandEvent& event); void OnPluginPAD(wxCommandEvent& event);
void OnPluginWiiMote(wxCommandEvent& event); void OnPluginWiimote(wxCommandEvent& event);
void OnOpen(wxCommandEvent& event); void OnOpen(wxCommandEvent& event);
void OnPlay(wxCommandEvent& event); void OnPlay(wxCommandEvent& event);
void OnStop(wxCommandEvent& event); void OnStop(wxCommandEvent& event);

View File

@ -57,6 +57,7 @@ enum
IDM_CONFIG_GFX_PLUGIN, IDM_CONFIG_GFX_PLUGIN,
IDM_CONFIG_DSP_PLUGIN, IDM_CONFIG_DSP_PLUGIN,
IDM_CONFIG_PAD_PLUGIN, IDM_CONFIG_PAD_PLUGIN,
IDM_CONFIG_WIIMOTE_PLUGIN,
IDM_TOGGLE_FULLSCREEN, IDM_TOGGLE_FULLSCREEN,
IDM_TOGGLE_DUALCORE, IDM_TOGGLE_DUALCORE,
IDM_TOGGLE_SKIPIDLE, IDM_TOGGLE_SKIPIDLE,

View File

@ -201,10 +201,13 @@ void CISOProperties::CreateGUIControls()
// GameConfig editing - Core overrides and emulation state // GameConfig editing - Core overrides and emulation state
sbCoreOverrides = new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Game-Specific Settings")); sbCoreOverrides = new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Game-Specific Settings"));
sCoreOverrides = new wxBoxSizer(wxVERTICAL); sCoreOverrides = new wxBoxSizer(wxVERTICAL);
OverrideText = new wxStaticText(m_GameConfig, ID_OVERRIDE_TEXT, _("These settings override core Dolphin settings.\nThe 3rd state means the game uses Dolphin's setting."), wxDefaultPosition, wxDefaultSize); OverrideText = new wxStaticText(m_GameConfig, ID_OVERRIDE_TEXT, _("These settings override core Dolphin settings. The 3rd state means the game uses Dolphin's setting."), wxDefaultPosition, wxDefaultSize);
UseDualCore = new wxCheckBox(m_GameConfig, ID_USEDUALCORE, _("Enable Dual Core"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); UseDualCore = new wxCheckBox(m_GameConfig, ID_USEDUALCORE, _("Enable Dual Core"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
SkipIdle = new wxCheckBox(m_GameConfig, ID_IDLESKIP, _("Enable Idle Skipping"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); SkipIdle = new wxCheckBox(m_GameConfig, ID_IDLESKIP, _("Enable Idle Skipping"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
OptimizeQuantizers = new wxCheckBox(m_GameConfig, ID_OPTIMIZEQUANTIZERS, _("Optimize Quantizers"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); OptimizeQuantizers = new wxCheckBox(m_GameConfig, ID_OPTIMIZEQUANTIZERS, _("Optimize Quantizers"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
EnableProgressiveScan = new wxCheckBox(m_GameConfig, ID_ENABLEPROGRESSIVESCAN, _("[Wii] Enable Progressive Scan"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
EnableWideScreen = new wxCheckBox(m_GameConfig, ID_ENABLEWIDESCREEN, _("[Wii] Enable WideScreen"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator);
sEmuState = new wxBoxSizer(wxHORIZONTAL); sEmuState = new wxBoxSizer(wxHORIZONTAL);
arrayStringFor_EmuState.Add(_("Not Set")); arrayStringFor_EmuState.Add(_("Not Set"));
arrayStringFor_EmuState.Add(_("Broken")); arrayStringFor_EmuState.Add(_("Broken"));
@ -243,6 +246,8 @@ void CISOProperties::CreateGUIControls()
sCoreOverrides->Add(UseDualCore, 0, wxEXPAND|wxLEFT, 5); sCoreOverrides->Add(UseDualCore, 0, wxEXPAND|wxLEFT, 5);
sCoreOverrides->Add(SkipIdle, 0, wxEXPAND|wxLEFT, 5); sCoreOverrides->Add(SkipIdle, 0, wxEXPAND|wxLEFT, 5);
sCoreOverrides->Add(OptimizeQuantizers, 0, wxEXPAND|wxLEFT, 5); sCoreOverrides->Add(OptimizeQuantizers, 0, wxEXPAND|wxLEFT, 5);
sCoreOverrides->Add(EnableProgressiveScan, 0, wxEXPAND|wxLEFT, 5);
sCoreOverrides->Add(EnableWideScreen, 0, wxEXPAND|wxLEFT, 5);
sEmuState->AddStretchSpacer(); sEmuState->AddStretchSpacer();
sEmuState->Add(EmuStateText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0); sEmuState->Add(EmuStateText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);
sEmuState->Add(EmuState, 0, wxEXPAND|wxALL, 0); sEmuState->Add(EmuState, 0, wxEXPAND|wxALL, 0);
@ -473,6 +478,16 @@ void CISOProperties::LoadGameConfig()
else else
OptimizeQuantizers->Set3StateValue(wxCHK_UNDETERMINED); OptimizeQuantizers->Set3StateValue(wxCHK_UNDETERMINED);
if (GameIni.Get("Core", "EnableProgressiveScan", &bTemp))
EnableProgressiveScan->Set3StateValue((wxCheckBoxState)bTemp);
else
EnableProgressiveScan->Set3StateValue(wxCHK_UNDETERMINED);
if (GameIni.Get("Core", "EnableWideScreen", &bTemp))
EnableWideScreen->Set3StateValue((wxCheckBoxState)bTemp);
else
EnableWideScreen->Set3StateValue(wxCHK_UNDETERMINED);
GameIni.Get("EmuState", "EmulationStateId", &iTemp, 0); GameIni.Get("EmuState", "EmulationStateId", &iTemp, 0);
EmuState->SetSelection(iTemp); EmuState->SetSelection(iTemp);
@ -499,6 +514,16 @@ bool CISOProperties::SaveGameConfig(std::string GameIniFile)
else else
GameIni.Set("Core", "OptimizeQuantizers", OptimizeQuantizers->Get3StateValue()); GameIni.Set("Core", "OptimizeQuantizers", OptimizeQuantizers->Get3StateValue());
if (EnableProgressiveScan->Get3StateValue() == wxCHK_UNDETERMINED)
GameIni.DeleteKey("Core", "EnableProgressiveScan");
else
GameIni.Set("Core", "EnableProgressiveScan", EnableProgressiveScan->Get3StateValue());
if (EnableWideScreen->Get3StateValue() == wxCHK_UNDETERMINED)
GameIni.DeleteKey("Core", "EnableWideScreen");
else
GameIni.Set("Core", "EnableWideScreen", EnableWideScreen->Get3StateValue());
GameIni.Set("EmuState", "EmulationStateId", EmuState->GetSelection()); GameIni.Set("EmuState", "EmulationStateId", EmuState->GetSelection());
return GameIni.Save(GameIniFile.c_str()); return GameIni.Save(GameIniFile.c_str());

View File

@ -73,6 +73,8 @@ class CISOProperties : public wxDialog
wxCheckBox *UseDualCore; wxCheckBox *UseDualCore;
wxCheckBox *SkipIdle; wxCheckBox *SkipIdle;
wxCheckBox *OptimizeQuantizers; wxCheckBox *OptimizeQuantizers;
wxCheckBox *EnableProgressiveScan, *EnableWideScreen; // Wii
wxStaticText *EmuStateText; wxStaticText *EmuStateText;
wxArrayString arrayStringFor_EmuState; wxArrayString arrayStringFor_EmuState;
wxChoice *EmuState; wxChoice *EmuState;
@ -131,6 +133,8 @@ class CISOProperties : public wxDialog
ID_OVERRIDE_TEXT, ID_OVERRIDE_TEXT,
ID_USEDUALCORE, ID_USEDUALCORE,
ID_IDLESKIP, ID_IDLESKIP,
ID_ENABLEPROGRESSIVESCAN,
ID_ENABLEWIDESCREEN,
ID_OPTIMIZEQUANTIZERS, ID_OPTIMIZEQUANTIZERS,
ID_EMUSTATE_TEXT, ID_EMUSTATE_TEXT,
ID_EMUSTATE, ID_EMUSTATE,

View File

@ -24,6 +24,28 @@
#include "PluginManager.h" #include "PluginManager.h"
#include "StringUtil.h" #include "StringUtil.h"
/* Why does it crash if we try to open the debugger in the same instance like this? */
namespace PluginVideo
{
extern DynamicLibrary plugin;
extern bool IsLoaded();
extern bool LoadPlugin(const char *_Filename);
extern void Debug(HWND _hwnd, bool Show);
}
namespace PluginDSP
{
extern DynamicLibrary plugin;
extern bool IsLoaded();
extern bool LoadPlugin(const char *_Filename);
extern void Debug(HWND _hwnd, bool Show);
}
//void(__cdecl * m_DllDebugger) (HWND _hParent) = 0;
CPluginManager CPluginManager::m_Instance; CPluginManager CPluginManager::m_Instance;
@ -35,6 +57,9 @@ CPluginManager::~CPluginManager()
{} {}
// ----------------------------------------
// Create list of avaliable plugins
// -------------
void CPluginManager::ScanForPlugins(wxWindow* _wxWindow) void CPluginManager::ScanForPlugins(wxWindow* _wxWindow)
{ {
m_PluginInfos.clear(); m_PluginInfos.clear();
@ -98,24 +123,49 @@ void CPluginManager::ScanForPlugins(wxWindow* _wxWindow)
} }
} }
// ----------------------------------------
// Open config window. _rFilename = plugin filename ,ret = the dll slot number
// -------------
void CPluginManager::OpenConfig(void* _Parent, const char *_rFilename) void CPluginManager::OpenConfig(void* _Parent, const char *_rFilename)
{ {
if (Common::CPlugin::Load(_rFilename)) int ret = Common::CPlugin::Load(_rFilename);
{
Common::CPlugin::Config((HWND)_Parent); Common::CPlugin::Config((HWND)_Parent);
Common::CPlugin::Release(); Common::CPlugin::Release();
}
} }
void CPluginManager::OpenDebug(void* _Parent, const char *_rFilename) // ----------------------------------------
// Open debugging window. Type = Video or DSP. Show = Show or hide window.
// -------------
void CPluginManager::OpenDebug(void* _Parent, const char *_rFilename, bool Type, bool Show)
{ {
if (Common::CPlugin::Load(_rFilename)) //int ret = 1;
//int ret = Common::CPlugin::Load(_rFilename, true);
//int ret = PluginVideo::LoadPlugin(_rFilename);
//int ret = PluginDSP::LoadPlugin(_rFilename);
if(Type)
{ {
Common::CPlugin::Debug((HWND)_Parent); //Common::CPlugin::Debug((HWND)_Parent);
//Common::CPlugin::Release(); // this is only if the wx dialog is called with ShowModal() if(!PluginVideo::IsLoaded()) PluginVideo::LoadPlugin(_rFilename);
PluginVideo::Debug((HWND)_Parent, Show);
} }
else
{
if(!PluginDSP::IsLoaded()) PluginDSP::LoadPlugin(_rFilename);
PluginDSP::Debug((HWND)_Parent, Show);
}
//Common::CPlugin::Release(); // this is only if the wx dialog is called with ShowModal()
//m_DllDebugger = (void (__cdecl*)(HWND))PluginVideo::plugin.Get("DllDebugger");
//m_DllDebugger(NULL);
} }
// ----------------------------------------
// Get dll info
// -------------
CPluginInfo::CPluginInfo(const char *_rFileName) CPluginInfo::CPluginInfo(const char *_rFileName)
: m_FileName(_rFileName) : m_FileName(_rFileName)
, m_Valid(false) , m_Valid(false)

View File

@ -42,7 +42,7 @@ public:
static CPluginManager& GetInstance() {return(m_Instance);} static CPluginManager& GetInstance() {return(m_Instance);}
void ScanForPlugins(wxWindow* _wxWindow); void ScanForPlugins(wxWindow* _wxWindow);
void OpenConfig(void* _Parent, const char *_rFilename); void OpenConfig(void* _Parent, const char *_rFilename);
void OpenDebug(void* _Parent, const char *_rFilename); void OpenDebug(void* _Parent, const char *_rFilename, bool Type, bool Show);
const CPluginInfos& GetPluginInfos() {return(m_PluginInfos);} const CPluginInfos& GetPluginInfos() {return(m_PluginInfos);}
private: private:

View File

@ -49,22 +49,13 @@ EXPORT void CALL GetDllInfo(PLUGIN_INFO* _pPluginInfo);
// //
EXPORT void CALL DllConfig(HWND _hParent); EXPORT void CALL DllConfig(HWND _hParent);
// __________________________________________________________________________________________________
// Function: DllConfig
// Purpose: This function is optional function that is provided
// to allow the user to configure the DLL
// input: a handle to the window that calls this function
// output: none
//
EXPORT void CALL DllConfig(HWND _hParent);
// __________________________________________________________________________________________________ // __________________________________________________________________________________________________
// Function: DllDebugger // Function: DllDebugger
// Purpose: Open the debugger // Purpose: Open the debugger
// input: a handle to the window that calls this function // input: a handle to the window that calls this function
// output: none // output: none
// //
EXPORT void CALL DllDebugger(HWND _hParent); EXPORT void CALL DllDebugger(HWND _hParent, bool Show);
// __________________________________________________________________________________________________ // __________________________________________________________________________________________________
// Function: DSP_Initialize // Function: DSP_Initialize

View File

@ -101,7 +101,7 @@ EXPORT void CALL DllConfig(HWND _hParent);
// input: a handle to the window that calls this function // input: a handle to the window that calls this function
// output: none // output: none
// //
EXPORT void CALL DllDebugger(HWND _hParent); EXPORT void CALL DllDebugger(HWND _hParent, bool Show);
// __________________________________________________________________________________________________ // __________________________________________________________________________________________________
// Function: Video_Initialize // Function: Video_Initialize

View File

@ -150,10 +150,21 @@ void CloseConsole()
// because then DLL_PROCESS_DETACH is called immediately after DLL_PROCESS_ATTACH. // because then DLL_PROCESS_DETACH is called immediately after DLL_PROCESS_ATTACH.
// ------------------- // -------------------
CDebugger* m_frame; CDebugger* m_frame;
void DllDebugger(HWND _hParent) void DllDebugger(HWND _hParent, bool Show)
{ {
if(m_frame && Show) // if we have created it, let us show it again
{
m_frame->Show();
}
else if(!m_frame && Show)
{
m_frame = new CDebugger(NULL); m_frame = new CDebugger(NULL);
m_frame->Show(); m_frame->Show();
}
else if(m_frame && !Show)
{
m_frame->Hide();
}
} }
// =================== // ===================

View File

@ -123,7 +123,7 @@ void DSP_DoState(unsigned char **ptr, int mode) {
PointerWrap p(ptr, mode); PointerWrap p(ptr, mode);
} }
void DllDebugger(HWND _hParent) void DllDebugger(HWND _hParent, bool Show)
{ {
#ifdef _WIN32 #ifdef _WIN32
#if defined (_DEBUG) || defined (DEBUGFAST) #if defined (_DEBUG) || defined (DEBUGFAST)

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="9.00" Version="9,00"
Name="Plugin_VideoOGL" Name="Plugin_VideoOGL"
ProjectGUID="{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}" ProjectGUID="{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}"
RootNamespace="Plugin_VideoOGL" RootNamespace="Plugin_VideoOGL"

View File

@ -45,6 +45,9 @@ void Config::Load()
iniFile.Get("Hardware", "Fullscreen", &bFullscreen, 0); // Hardware iniFile.Get("Hardware", "Fullscreen", &bFullscreen, 0); // Hardware
iniFile.Get("Hardware", "RenderToMainframe", &renderToMainframe, 0); iniFile.Get("Hardware", "RenderToMainframe", &renderToMainframe, 0);
iniFile.Get("Settings", "StretchToFit", &bStretchToFit, false);
iniFile.Get("Settings", "KeepAR", &bKeepAR, false);
iniFile.Get("Settings", "HideCursor", &bHideCursor, false);
iniFile.Get("Settings", "ShowFPS", &bShowFPS, false); // Settings iniFile.Get("Settings", "ShowFPS", &bShowFPS, false); // Settings
iniFile.Get("Settings", "OverlayStats", &bOverlayStats, false); iniFile.Get("Settings", "OverlayStats", &bOverlayStats, false);
@ -73,8 +76,7 @@ void Config::Load()
iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0); iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0);
iniFile.Get("Enhancements", "ForceMaxAniso", &bForceMaxAniso, 0); iniFile.Get("Enhancements", "ForceMaxAniso", &bForceMaxAniso, 0);
iniFile.Get("Enhancements", "StretchToFit", &bStretchToFit, false);
iniFile.Get("Enhancements", "KeepAR", &bKeepAR, false);
iniFile.Get("Hacks", "EFBToTextureDisable", &bEBFToTextureDisable, 0); iniFile.Get("Hacks", "EFBToTextureDisable", &bEBFToTextureDisable, 0);
} }
@ -87,6 +89,9 @@ void Config::Save()
iniFile.Set("Hardware", "FullscreenRes", iFSResolution); iniFile.Set("Hardware", "FullscreenRes", iFSResolution);
iniFile.Set("Hardware", "Fullscreen", bFullscreen); iniFile.Set("Hardware", "Fullscreen", bFullscreen);
iniFile.Set("Hardware", "RenderToMainframe", renderToMainframe); iniFile.Set("Hardware", "RenderToMainframe", renderToMainframe);
iniFile.Set("Settings", "StretchToFit", bStretchToFit);
iniFile.Set("Settings", "KeepAR", bKeepAR);
iniFile.Set("Settings", "HideCursor", bHideCursor);
iniFile.Set("Settings", "ShowFPS", bShowFPS); iniFile.Set("Settings", "ShowFPS", bShowFPS);
iniFile.Set("Settings", "OverlayStats", bOverlayStats); iniFile.Set("Settings", "OverlayStats", bOverlayStats);
@ -105,8 +110,6 @@ void Config::Save()
iniFile.Set("Enhancements", "ForceFiltering", bForceFiltering); iniFile.Set("Enhancements", "ForceFiltering", bForceFiltering);
iniFile.Set("Enhancements", "ForceMaxAniso", bForceMaxAniso); iniFile.Set("Enhancements", "ForceMaxAniso", bForceMaxAniso);
iniFile.Set("Enhancements", "StretchToFit", bStretchToFit);
iniFile.Set("Enhancements", "KeepAR", bKeepAR);
iniFile.Set("Hacks", "EFBToTextureDisable", bEBFToTextureDisable); iniFile.Set("Hacks", "EFBToTextureDisable", bEBFToTextureDisable);

View File

@ -37,6 +37,7 @@ struct Config
char iWindowedRes[16]; char iWindowedRes[16];
bool bStretchToFit; bool bStretchToFit;
bool bKeepAR; bool bKeepAR;
bool bHideCursor;
// Enhancements // Enhancements
int iMultisampleMode; int iMultisampleMode;

View File

@ -35,6 +35,7 @@ BEGIN_EVENT_TABLE(ConfigDialog,wxDialog)
EVT_CHECKBOX(ID_FORCEANISOTROPY, ConfigDialog::GeneralSettingsChanged) EVT_CHECKBOX(ID_FORCEANISOTROPY, ConfigDialog::GeneralSettingsChanged)
EVT_CHECKBOX(ID_STRETCHTOFIT, ConfigDialog::GeneralSettingsChanged) EVT_CHECKBOX(ID_STRETCHTOFIT, ConfigDialog::GeneralSettingsChanged)
EVT_CHECKBOX(ID_KEEPAR, ConfigDialog::GeneralSettingsChanged) EVT_CHECKBOX(ID_KEEPAR, ConfigDialog::GeneralSettingsChanged)
EVT_CHECKBOX(ID_HIDECURSOR, ConfigDialog::GeneralSettingsChanged)
EVT_CHECKBOX(ID_WIREFRAME, ConfigDialog::AdvancedSettingsChanged) EVT_CHECKBOX(ID_WIREFRAME, ConfigDialog::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_SHOWFPS, ConfigDialog::AdvancedSettingsChanged) EVT_CHECKBOX(ID_SHOWFPS, ConfigDialog::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_STATISTICS, ConfigDialog::AdvancedSettingsChanged) EVT_CHECKBOX(ID_STATISTICS, ConfigDialog::AdvancedSettingsChanged)
@ -98,6 +99,8 @@ void ConfigDialog::CreateGUIControls()
m_StretchToFit->SetValue(g_Config.bStretchToFit); m_StretchToFit->SetValue(g_Config.bStretchToFit);
m_KeepAR = new wxCheckBox(m_PageGeneral, ID_KEEPAR, wxT("Keep 4:3 aspect ratio"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); m_KeepAR = new wxCheckBox(m_PageGeneral, ID_KEEPAR, wxT("Keep 4:3 aspect ratio"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_KeepAR->SetValue(g_Config.bKeepAR); m_KeepAR->SetValue(g_Config.bKeepAR);
m_HideCursor = new wxCheckBox(m_PageGeneral, ID_HIDECURSOR, wxT("Hide mouse cursor"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_HideCursor->SetValue(g_Config.bHideCursor);
wxStaticText *FSText = new wxStaticText(m_PageGeneral, ID_FSTEXT, wxT("Fullscreen video mode:"), wxDefaultPosition, wxDefaultSize, 0); wxStaticText *FSText = new wxStaticText(m_PageGeneral, ID_FSTEXT, wxT("Fullscreen video mode:"), wxDefaultPosition, wxDefaultSize, 0);
m_FullscreenCB = new wxComboBox(m_PageGeneral, ID_FULLSCREENCB, wxEmptyString, wxDefaultPosition, wxDefaultSize, arrayStringFor_FullscreenCB, 0, wxDefaultValidator); m_FullscreenCB = new wxComboBox(m_PageGeneral, ID_FULLSCREENCB, wxEmptyString, wxDefaultPosition, wxDefaultSize, arrayStringFor_FullscreenCB, 0, wxDefaultValidator);
m_FullscreenCB->SetValue(wxString::FromAscii(g_Config.iFSResolution)); m_FullscreenCB->SetValue(wxString::FromAscii(g_Config.iFSResolution));
@ -119,16 +122,18 @@ void ConfigDialog::CreateGUIControls()
tmp<<g_Config.iMultisampleMode; tmp<<g_Config.iMultisampleMode;
m_AliasModeCB->SetValue(tmp); m_AliasModeCB->SetValue(tmp);
// Usage: The wxGBPosition() must have a column and row
sGeneral = new wxBoxSizer(wxVERTICAL); sGeneral = new wxBoxSizer(wxVERTICAL);
sBasic = new wxGridBagSizer(0, 0); sBasic = new wxGridBagSizer(0, 0);
sBasic->Add(m_Fullscreen, wxGBPosition(0, 0), wxGBSpan(1, 2), wxALL, 5); sBasic->Add(m_Fullscreen, wxGBPosition(0, 0), wxGBSpan(1, 2), wxALL, 5);
sBasic->Add(m_RenderToMainWindow, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL, 5); sBasic->Add(m_RenderToMainWindow, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL, 5);
sBasic->Add(m_StretchToFit, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL, 5); sBasic->Add(m_StretchToFit, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL, 5);
sBasic->Add(m_KeepAR, wxGBPosition(3, 0), wxGBSpan(1, 2), wxALL, 5); sBasic->Add(m_KeepAR, wxGBPosition(3, 0), wxGBSpan(1, 2), wxALL, 5);
sBasic->Add(FSText, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5); sBasic->Add(m_HideCursor, wxGBPosition(4, 0), wxGBSpan(1, 2), wxALL, 5);
sBasic->Add(m_FullscreenCB, wxGBPosition(4, 1), wxGBSpan(1, 1), wxALL, 5); sBasic->Add(FSText, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sBasic->Add(WMText, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5); sBasic->Add(m_FullscreenCB, wxGBPosition(5, 1), wxGBSpan(1, 1), wxALL, 5);
sBasic->Add(m_WindowResolutionCB, wxGBPosition(5, 1), wxGBSpan(1, 1), wxALL, 5); sBasic->Add(WMText, wxGBPosition(6, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sBasic->Add(m_WindowResolutionCB, wxGBPosition(6, 1), wxGBSpan(1, 1), wxALL, 5);
sbBasic->Add(sBasic); sbBasic->Add(sBasic);
sGeneral->Add(sbBasic, 0, wxEXPAND|wxALL, 5); sGeneral->Add(sbBasic, 0, wxEXPAND|wxALL, 5);
@ -222,6 +227,8 @@ void ConfigDialog::CreateGUIControls()
void ConfigDialog::OnClose(wxCloseEvent& WXUNUSED (event)) void ConfigDialog::OnClose(wxCloseEvent& WXUNUSED (event))
{ {
/* notice that we don't run wxEntryCleanup(); here so the dll will
still be loaded */
g_Config.Save(); g_Config.Save();
EndModal(0); EndModal(0);
} }
@ -272,6 +279,9 @@ void ConfigDialog::GeneralSettingsChanged(wxCommandEvent& event)
case ID_KEEPAR: case ID_KEEPAR:
g_Config.bKeepAR = m_KeepAR->IsChecked(); g_Config.bKeepAR = m_KeepAR->IsChecked();
break; break;
case ID_HIDECURSOR:
g_Config.bHideCursor = m_HideCursor->IsChecked();
break;
case ID_FULLSCREENCB: case ID_FULLSCREENCB:
strcpy(g_Config.iFSResolution, m_FullscreenCB->GetValue().mb_str() ); strcpy(g_Config.iFSResolution, m_FullscreenCB->GetValue().mb_str() );
break; break;

View File

@ -73,11 +73,13 @@ class ConfigDialog : public wxDialog
wxCheckBox *m_RenderToMainWindow; wxCheckBox *m_RenderToMainWindow;
wxCheckBox *m_StretchToFit; wxCheckBox *m_StretchToFit;
wxCheckBox *m_KeepAR; wxCheckBox *m_KeepAR;
wxCheckBox *m_HideCursor;
wxArrayString arrayStringFor_FullscreenCB; wxArrayString arrayStringFor_FullscreenCB;
wxComboBox *m_FullscreenCB; wxComboBox *m_FullscreenCB;
wxArrayString arrayStringFor_WindowResolutionCB; wxArrayString arrayStringFor_WindowResolutionCB;
wxComboBox *m_WindowResolutionCB; wxComboBox *m_WindowResolutionCB;
wxCheckBox *m_ForceFiltering;
wxCheckBox *m_ForceFiltering; // advanced
wxCheckBox *m_ForceAnisotropy; wxCheckBox *m_ForceAnisotropy;
wxComboBox *m_AliasModeCB; wxComboBox *m_AliasModeCB;
wxCheckBox *m_ShowFPS; wxCheckBox *m_ShowFPS;
@ -106,6 +108,7 @@ class ConfigDialog : public wxDialog
ID_RENDERTOMAINWINDOW, ID_RENDERTOMAINWINDOW,
ID_STRETCHTOFIT, ID_STRETCHTOFIT,
ID_KEEPAR, ID_KEEPAR,
ID_HIDECURSOR,
ID_FSTEXT, ID_FSTEXT,
ID_FULLSCREENCB, ID_FULLSCREENCB,
ID_WMTEXT, ID_WMTEXT,

View File

@ -89,6 +89,21 @@ namespace EmuWindow
const TCHAR m_szClassName[] = "DolphinEmuWnd"; const TCHAR m_szClassName[] = "DolphinEmuWnd";
int g_winstyle; int g_winstyle;
// ------------------------------------------
/* Invisible cursor option. In the lack of a predefined IDC_BLANK we make
an empty transparent cursor */
// ------------------
HCURSOR hCursor = NULL, hCursorBlank = NULL;
void CreateCursors(HINSTANCE hInstance)
{
BYTE ANDmaskCursor[] = { 0xff };
BYTE XORmaskCursor[] = { 0x00 };
hCursorBlank = CreateCursor(hInstance, 0,0, 1,1, ANDmaskCursor,XORmaskCursor);
hCursor = LoadCursor( NULL, IDC_ARROW );
}
HWND GetWnd() HWND GetWnd()
{ {
return m_hWnd; return m_hWnd;
@ -125,6 +140,18 @@ namespace EmuWindow
g_VideoInitialize.pKeyPress(LOWORD(wParam), GetAsyncKeyState(VK_SHIFT) != 0, GetAsyncKeyState(VK_CONTROL) != 0); g_VideoInitialize.pKeyPress(LOWORD(wParam), GetAsyncKeyState(VK_SHIFT) != 0, GetAsyncKeyState(VK_CONTROL) != 0);
break; break;
/* The reason we pick up the WM_MOUSEMOVE is to be able to change this option
during gameplay. The alternative is to load one of the cursors when the plugin
is loaded and go with that. This should only produce a minimal performance hit
because SetCursor is not supposed to actually change the cursor if it's the
same as the one before. */
case WM_MOUSEMOVE:
if(g_Config.bHideCursor)
SetCursor(hCursorBlank);
else
SetCursor(hCursor);
break;
case WM_CLOSE: case WM_CLOSE:
ExitProcess(0); ExitProcess(0);
@ -159,7 +186,8 @@ namespace EmuWindow
wndClass.cbWndExtra = 0; wndClass.cbWndExtra = 0;
wndClass.hInstance = hInstance; wndClass.hInstance = hInstance;
wndClass.hIcon = LoadIcon( NULL, IDI_APPLICATION ); wndClass.hIcon = LoadIcon( NULL, IDI_APPLICATION );
wndClass.hCursor = LoadCursor( NULL, IDC_ARROW ); //wndClass.hCursor = LoadCursor( NULL, IDC_ARROW );
wndClass.hCursor = NULL; // to interfer less with SetCursor() later
wndClass.hbrBackground = (HBRUSH)GetStockObject( BLACK_BRUSH ); wndClass.hbrBackground = (HBRUSH)GetStockObject( BLACK_BRUSH );
wndClass.lpszMenuName = NULL; wndClass.lpszMenuName = NULL;
wndClass.lpszClassName = m_szClassName; wndClass.lpszClassName = m_szClassName;
@ -168,6 +196,8 @@ namespace EmuWindow
m_hInstance = hInstance; m_hInstance = hInstance;
RegisterClassEx( &wndClass ); RegisterClassEx( &wndClass );
CreateCursors(m_hInstance);
if (parent) if (parent)
{ {
m_hWnd = CreateWindow(m_szClassName, title, m_hWnd = CreateWindow(m_szClassName, title,
@ -216,11 +246,13 @@ namespace EmuWindow
// gShowDebugger from main.cpp is forgotten between the Dolphin-Debugger is opened and a game is // gShowDebugger from main.cpp is forgotten between the Dolphin-Debugger is opened and a game is
// started so we have to use an ini file setting here // started so we have to use an ini file setting here
/*
bool bVideoWindow = false; bool bVideoWindow = false;
IniFile ini; IniFile ini;
ini.Load(DEBUGGER_CONFIG_FILE); ini.Load(DEBUGGER_CONFIG_FILE);
ini.Get("ShowOnStart", "VideoWindow", &bVideoWindow, false); ini.Get("ShowOnStart", "VideoWindow", &bVideoWindow, false);
if(bVideoWindow) DoDllDebugger(); if(bVideoWindow) DoDllDebugger();
*/
} }
HWND Create(HWND hParent, HINSTANCE hInstance, const TCHAR *title) HWND Create(HWND hParent, HINSTANCE hInstance, const TCHAR *title)

View File

@ -54,33 +54,42 @@
SVideoInitialize g_VideoInitialize; SVideoInitialize g_VideoInitialize;
#define VERSION_STRING "0.1" #define VERSION_STRING "0.1"
// Create debugging window. We can't use Show() here as usual because then DLL_PROCESS_DETACH will
// be called immediately. And if we use ShowModal() we block the main video window from appearing. /* Create debugging window. There's currently a strange crash that occurs whe a game is loaded
// So I've made a separate function called DoDllDebugger() that creates the window. if the OpenGL plugin was loaded before. I'll try to fix that. Currently you may have to
clsoe the window if it has auto started, and then restart it after the dll has loaded
for the purpose of the game. At that point there is no need to use the same dll instance
as the one that is rendering the game. However, that could be done. */
#if defined(OSX64) #if defined(OSX64)
void DllDebugger(HWND _hParent) { } void DllDebugger(HWND _hParent) { }
void DoDllDebugger() { } void DoDllDebugger() { }
#else #else
CDebugger* m_frame; CDebugger* m_frame;
void DllDebugger(HWND _hParent) void DllDebugger(HWND _hParent, bool Show)
{ {
if(m_frame) // if we have created it, let us show it again if(m_frame && Show) // if we have created it, let us show it again
{ {
m_frame->Show(); m_frame->Show();
} }
else else if(!m_frame && Show)
{ {
wxMessageBox(_T("The debugging window will open after you start a game.")); m_frame = new CDebugger(NULL);
m_frame->Show();
}
else if(m_frame && !Show)
{
m_frame->Hide();
} }
} }
void DoDllDebugger() void DoDllDebugger()
{ {
m_frame = new CDebugger(NULL); //m_frame = new CDebugger(NULL);
m_frame->Show(); //m_frame->Show();
} }
#endif #endif
void GetDllInfo (PLUGIN_INFO* _PluginInfo) void GetDllInfo (PLUGIN_INFO* _PluginInfo)
{ {
_PluginInfo->Version = 0x0100; _PluginInfo->Version = 0x0100;
@ -99,9 +108,13 @@ void GetDllInfo (PLUGIN_INFO* _PluginInfo)
void DllConfig(HWND _hParent) void DllConfig(HWND _hParent)
{ {
#if defined(_WIN32) #if defined(_WIN32)
wxWindow win; //wxWindow win;
win.SetHWND(_hParent); //win.SetHWND(_hParent);
ConfigDialog frame(&win); //ConfigDialog frame(&win);
//ConfigDialog frame(NULL);
ConfigDialog *frame;
frame = new ConfigDialog(NULL);
DWORD iModeNum = 0; DWORD iModeNum = 0;
DEVMODE dmi; DEVMODE dmi;
@ -130,13 +143,16 @@ void DllConfig(HWND _hParent)
{ {
resos[i] = strBuffer; resos[i] = strBuffer;
i++; i++;
frame.AddFSReso(szBuffer); //frame.AddFSReso(szBuffer);
frame.AddWindowReso(szBuffer); //frame.AddWindowReso(szBuffer);
frame->AddFSReso(szBuffer);
frame->AddWindowReso(szBuffer);
} }
ZeroMemory(&dmi, sizeof(dmi)); ZeroMemory(&dmi, sizeof(dmi));
} }
frame.ShowModal(); //frame.ShowModal();
win.SetHWND(0); frame->ShowModal();
//win.SetHWND(0);
#elif defined(__linux__) #elif defined(__linux__)
ConfigDialog frame(NULL); ConfigDialog frame(NULL);
@ -186,6 +202,15 @@ void Video_Initialize(SVideoInitialize* _pVideoInitialize)
// OpenConsole(); // OpenConsole();
#endif #endif
/* Dolphin currently crashes if the dll is loaded when a game is started so we clsoe the
debugger and open it again after loading */
/*
if(m_frame)
{
m_frame->EndModal(0); wxEntryCleanup();
}//use wxUninitialize() if you don't want GUI
*/
frameCount = 0; frameCount = 0;
g_VideoInitialize = *_pVideoInitialize; g_VideoInitialize = *_pVideoInitialize;
InitLUTs(); InitLUTs();

View File

@ -577,6 +577,26 @@
> >
</File> </File>
</Filter> </Filter>
<Filter
Name="Config"
>
<File
RelativePath=".\Src\Config.cpp"
>
</File>
<File
RelativePath=".\Src\Config.h"
>
</File>
<File
RelativePath=".\Src\ConfigDlg.cpp"
>
</File>
<File
RelativePath=".\Src\ConfigDlg.h"
>
</File>
</Filter>
<File <File
RelativePath=".\Src\main.cpp" RelativePath=".\Src\main.cpp"
> >

View File

@ -0,0 +1,50 @@
// 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 "Common.h"
#include "IniFile.h"
#include "Config.h"
Config g_Config;
Config::Config()
{
memset(this, 0, sizeof(Config));
}
void Config::Load()
{
std::string temp;
IniFile iniFile;
iniFile.Load(FULL_CONFIG_DIR "Wiimote.ini");
// get resolution
iniFile.Get("Settings", "SidewaysDPad", &bSidewaysDPad, 0); // Hardware
iniFile.Get("Settings", "WideScreen", &bWideScreen, 0);
}
void Config::Save()
{
IniFile iniFile;
iniFile.Load(FULL_CONFIG_DIR "Wiimote.ini");
iniFile.Set("Settings", "SidewaysDPad", bSidewaysDPad);
iniFile.Set("Settings", "WideScreen", bWideScreen);
iniFile.Save(FULL_CONFIG_DIR "Wiimote.ini");
}

View File

@ -0,0 +1,40 @@
// 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
#define CONF_LOG 1
#define CONF_PRIMLOG 2
#define CONF_SAVETEXTURES 4
#define CONF_SAVETARGETS 8
#define CONF_SAVESHADERS 16
struct Config
{
Config();
void Load();
void Save();
// General
bool bSidewaysDPad;
bool bWideScreen;
};
extern Config g_Config;
#endif // _CONFIG_H

View File

@ -0,0 +1,124 @@
// 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 "ConfigDlg.h"
#include "Config.h"
BEGIN_EVENT_TABLE(ConfigDialog,wxDialog)
EVT_CLOSE(ConfigDialog::OnClose)
EVT_BUTTON(ID_CLOSE, ConfigDialog::CloseClick)
EVT_BUTTON(ID_ABOUTOGL, ConfigDialog::AboutClick)
EVT_CHECKBOX(ID_SIDEWAYSDPAD, ConfigDialog::GeneralSettingsChanged)
EVT_CHECKBOX(ID_WIDESCREEN, ConfigDialog::GeneralSettingsChanged)
END_EVENT_TABLE()
ConfigDialog::ConfigDialog(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
: wxDialog(parent, id, title, position, size, style)
{
g_Config.Load();
CreateGUIControls();
}
ConfigDialog::~ConfigDialog()
{
}
void ConfigDialog::CreateGUIControls()
{
// Notebook
m_Notebook = new wxNotebook(this, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize);
m_PageGeneral = new wxPanel(m_Notebook, ID_PAGEGENERAL, wxDefaultPosition, wxDefaultSize);
m_Notebook->AddPage(m_PageGeneral, wxT("General"));
// Buttons
//m_About = new wxButton(this, ID_ABOUTOGL, wxT("About"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_Close = new wxButton(this, ID_CLOSE, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
// Put notebook and buttons in sizers
wxBoxSizer* sButtons;
sButtons = new wxBoxSizer(wxHORIZONTAL);
//sButtons->Add(m_About, 0, wxALL, 5); // there is no about
sButtons->AddStretchSpacer();
sButtons->Add(m_Close, 0, wxALL, 5);
wxBoxSizer* sMain;
sMain = new wxBoxSizer(wxVERTICAL);
sMain->Add(m_Notebook, 1, wxEXPAND|wxALL, 5);
sMain->Add(sButtons, 0, wxEXPAND, 5);
// General
sbBasic = new wxStaticBoxSizer(wxVERTICAL, m_PageGeneral, wxT("Basic Settings"));
m_SidewaysDPad = new wxCheckBox(m_PageGeneral, ID_SIDEWAYSDPAD, wxT("Enable Sideways D-Pad"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_SidewaysDPad->SetValue(g_Config.bSidewaysDPad);
m_WideScreen = new wxCheckBox(m_PageGeneral, ID_WIDESCREEN, wxT("WideScreen Mode (for correct aiming)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_WideScreen->SetValue(g_Config.bWideScreen);
// ----------------------------------------------------------------------
// Set up sGeneral and sBasic
// Usage: The wxGBPosition() must have a column and row
// ----------------
sGeneral = new wxBoxSizer(wxVERTICAL);
sBasic = new wxGridBagSizer(0, 0);
sBasic->Add(m_SidewaysDPad, wxGBPosition(0, 0), wxGBSpan(1, 2), wxALL, 5);
sBasic->Add(m_WideScreen, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL, 5);
sbBasic->Add(sBasic);
sGeneral->Add(sbBasic, 0, wxEXPAND|wxALL, 5);
m_PageGeneral->SetSizer(sGeneral);
sGeneral->Layout();
this->SetSizer(sMain);
this->Layout();
// ----------------
Fit();
Center();
}
void ConfigDialog::OnClose(wxCloseEvent& WXUNUSED (event))
{
g_Config.Save();
EndModal(0);
}
void ConfigDialog::CloseClick(wxCommandEvent& WXUNUSED (event))
{
Close();
}
void ConfigDialog::AboutClick(wxCommandEvent& WXUNUSED (event))
{
}
void ConfigDialog::GeneralSettingsChanged(wxCommandEvent& event)
{
switch (event.GetId())
{
case ID_SIDEWAYSDPAD:
g_Config.bSidewaysDPad = m_SidewaysDPad->IsChecked();
break;
case ID_WIDESCREEN:
g_Config.bWideScreen = m_WideScreen->IsChecked();
break;
}
}

View File

@ -0,0 +1,84 @@
// 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 __CONFIGDIALOG_h__
#define __CONFIGDIALOG_h__
#include <wx/wx.h>
#include <wx/dialog.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/stattext.h>
#include <wx/combobox.h>
#include <wx/checkbox.h>
#include <wx/notebook.h>
#include <wx/panel.h>
#include <wx/filepicker.h>
#include <wx/gbsizer.h>
#undef ConfigDialog_STYLE
#define ConfigDialog_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX
class ConfigDialog : public wxDialog
{
public:
ConfigDialog(wxWindow *parent, wxWindowID id = 1,
const wxString &title = wxT("Wii Remote Plugin Configuration"),
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = ConfigDialog_STYLE);
virtual ~ConfigDialog();
void CloseClick(wxCommandEvent& event);
private:
DECLARE_EVENT_TABLE();
wxBoxSizer* sGeneral;
wxStaticBoxSizer* sbBasic;
wxGridBagSizer* sBasic;
wxButton *m_About;
wxButton *m_Close;
wxNotebook *m_Notebook;
wxPanel *m_PageGeneral;
wxPanel *m_PageAdvanced;
wxCheckBox *m_SidewaysDPad; // general settings
wxCheckBox *m_WideScreen;
enum
{
ID_CLOSE = 1000,
ID_ABOUTOGL,
ID_NOTEBOOK,
ID_PAGEGENERAL,
ID_PAGEADVANCED,
ID_SIDEWAYSDPAD,
ID_WIDESCREEN
};
void OnClose(wxCloseEvent& event);
void CreateGUIControls();
void AboutClick(wxCommandEvent& event);
void GeneralSettingsChanged(wxCommandEvent& event);
};
#endif

View File

@ -46,6 +46,12 @@ namespace WiiMoteEmu
#define BOTTOM 728 #define BOTTOM 728
#define SENSOR_BAR_RADIUS 200 #define SENSOR_BAR_RADIUS 200
#define wLEFT 332
#define wTOP 348
#define wRIGHT 693
#define wBOTTOM 625
#define wSENSOR_BAR_RADIUS 200
// vars // vars
#define WIIMOTE_EEPROM_SIZE (16*1024) #define WIIMOTE_EEPROM_SIZE (16*1024)
#define WIIMOTE_REG_SPEAKER_SIZE 10 #define WIIMOTE_REG_SPEAKER_SIZE 10

View File

@ -27,6 +27,7 @@
#include "EmuDeclarations.h" #include "EmuDeclarations.h"
#include "EmuDefinitions.h" #include "EmuDefinitions.h"
#include "Console.h" // for startConsoleWin, wprintf, GetConsoleHwnd #include "Console.h" // for startConsoleWin, wprintf, GetConsoleHwnd
#include "Config.h" // for g_Config
extern SWiimoteInitialize g_WiimoteInitialize; extern SWiimoteInitialize g_WiimoteInitialize;
//extern void __Log(int log, const char *format, ...); //extern void __Log(int log, const char *format, ...);
@ -60,17 +61,11 @@ void FillReportInfo(wm_core& _core)
_core.minus = GetAsyncKeyState('M') ? 1 : 0; _core.minus = GetAsyncKeyState('M') ? 1 : 0;
_core.home = GetAsyncKeyState('H') ? 1 : 0; _core.home = GetAsyncKeyState('H') ? 1 : 0;
if(GetAsyncKeyState('T'))
{
wxMessageBox(wxString::Format("You turned %s sideways controls",
toggleSideWays ? "off" : "on"));
toggleSideWays = !toggleSideWays;
}
/* Sideways controls (for example for Wario Land) was not enabled automatically /* Sideways controls (for example for Wario Land) was not enabled automatically
so I have to use this function. I'm not sure how it works on the actual Wii. so I have to use this function. I'm not sure how it works on the actual Wii.
*/ */
if(toggleSideWays) if(g_Config.bSidewaysDPad)
{ {
_core.left = GetAsyncKeyState(VK_DOWN) ? 1 : 0; _core.left = GetAsyncKeyState(VK_DOWN) ? 1 : 0;
_core.up = GetAsyncKeyState(VK_LEFT) ? 1 : 0; _core.up = GetAsyncKeyState(VK_LEFT) ? 1 : 0;
@ -302,14 +297,29 @@ void FillReportAcc(wm_accel& _acc)
*/ */
} }
/* DESCRIPTION: The calibration is controlled by these values, their absolute value and bool toggleWideScreen = false, toggleCursor = true;
the relative distance between between them control the calibration. These integers is
for the debugger so that we can calibrate the best values */
int Top = TOP, Left = LEFT, Right = RIGHT,
Bottom = BOTTOM, SensorBarRadius = SENSOR_BAR_RADIUS;
void FillReportIR(wm_ir_extended& _ir0, wm_ir_extended& _ir1) void FillReportIR(wm_ir_extended& _ir0, wm_ir_extended& _ir1)
{ {
/* DESCRIPTION: The calibration is controlled by these values, their absolute value and
the relative distance between between them control the calibration. WideScreen mode
has its own settings. */
/**/
int Top, Left, Right, Bottom, SensorBarRadius;
if(g_Config.bWideScreen)
{
Top = wTOP; Left = wLEFT; Right = wRIGHT;
Bottom = wBOTTOM; SensorBarRadius = wSENSOR_BAR_RADIUS;
}
else
{
Top = TOP; Left = LEFT; Right = RIGHT;
Bottom = BOTTOM; SensorBarRadius = SENSOR_BAR_RADIUS;
}
memset(&_ir0, 0xFF, sizeof(wm_ir_extended)); memset(&_ir0, 0xFF, sizeof(wm_ir_extended));
memset(&_ir1, 0xFF, sizeof(wm_ir_extended)); memset(&_ir1, 0xFF, sizeof(wm_ir_extended));
@ -340,7 +350,7 @@ void FillReportIR(wm_ir_extended& _ir0, wm_ir_extended& _ir1)
// ---------------------------- // ----------------------------
// Debugging for calibration // Debugging for calibration
// ---------- // ----------
/* /**/
if(GetAsyncKeyState(VK_NUMPAD1)) if(GetAsyncKeyState(VK_NUMPAD1))
Right +=1; Right +=1;
else if(GetAsyncKeyState(VK_NUMPAD2)) else if(GetAsyncKeyState(VK_NUMPAD2))
@ -363,11 +373,11 @@ void FillReportIR(wm_ir_extended& _ir0, wm_ir_extended& _ir1)
SensorBarRadius -= 1; SensorBarRadius -= 1;
//ClearScreen(); //ClearScreen();
if(consoleDisplay == 1) //if(consoleDisplay == 1)
wprintf("x0:%03i x1:%03i y0:%03i y1:%03i irx0:%03i y0:%03i x1:%03i y1:%03i | T:%i L:%i R:%i B:%i S:%i\n", wprintf("x0:%03i x1:%03i y0:%03i y1:%03i irx0:%03i y0:%03i x1:%03i y1:%03i | T:%i L:%i R:%i B:%i S:%i\n",
x0, x1, y0, y1, _ir0.x, _ir0.y, _ir1.x, _ir1.y, Top, Left, Right, Bottom, SensorBarRadius x0, x1, y0, y1, _ir0.x, _ir0.y, _ir1.x, _ir1.y, Top, Left, Right, Bottom, SensorBarRadius
); );
*/
} }

View File

@ -18,9 +18,11 @@
#if !defined(OSX64) #if !defined(OSX64)
#include <wx/aboutdlg.h> #include <wx/aboutdlg.h>
#include "ConfigDlg.h"
#endif #endif
#include "Common.h" #include "Common.h"
#include "Config.h"
#include "StringUtil.h" #include "StringUtil.h"
#include "pluginspecs_wiimote.h" #include "pluginspecs_wiimote.h"
@ -109,6 +111,17 @@ extern "C" void DllAbout(HWND _hParent)
extern "C" void DllConfig(HWND _hParent) extern "C" void DllConfig(HWND _hParent)
{ {
#if defined(_WIN32)
wxWindow win;
win.SetHWND(_hParent);
ConfigDialog frame(&win);
frame.ShowModal();
win.SetHWND(0);
#elif defined(__linux__)
//TODO
#else
//TODO
#endif
} }
extern "C" void Wiimote_Initialize(SWiimoteInitialize _WiimoteInitialize) extern "C" void Wiimote_Initialize(SWiimoteInitialize _WiimoteInitialize)
@ -117,9 +130,10 @@ extern "C" void Wiimote_Initialize(SWiimoteInitialize _WiimoteInitialize)
g_UseRealWiiMote = WiiMoteReal::Initialize() > 0; g_UseRealWiiMote = WiiMoteReal::Initialize() > 0;
WiiMoteEmu::Initialize(); WiiMoteEmu::Initialize();
g_Config.Load(); // load config settings
// Debugging window // Debugging window
/*startConsoleWin(160, 30, "Wiimote"); // give room for 20 rows /*startConsoleWin(160, 30, "Wiimote"); // give room for 20 rows
wprintf("Wiimote console opened\n"); wprintf("Wiimote console opened\n");