mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 06:39:46 -06:00
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:
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Version="9,00"
|
||||
Name="Common"
|
||||
ProjectGUID="{C573CAF7-EE6A-458E-8049-16C0BF34C2E9}"
|
||||
RootNamespace="Common"
|
||||
@ -267,7 +267,7 @@
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories="../../PluginSpecs"
|
||||
AdditionalIncludeDirectories="../../PluginSpecs;..\Core\Src"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
|
@ -56,26 +56,32 @@ std::string GetLastErrorAsString()
|
||||
}
|
||||
#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)
|
||||
{
|
||||
LOG(MASTER_LOG, "Missing filename of dynamic library to load");
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
LOG(MASTER_LOG, "Trying to load library %s", filename);
|
||||
|
||||
if (IsLoaded())
|
||||
{
|
||||
LOG(MASTER_LOG, "Trying to load already loaded library %s", filename);
|
||||
return false;
|
||||
return 2;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
library = LoadLibrary(filename);
|
||||
if (!library) {
|
||||
LOG(MASTER_LOG, "Error loading DLL %s: %s", filename, GetLastErrorAsString().c_str());
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
library = dlopen(filename, RTLD_NOW | RTLD_LOCAL);
|
||||
@ -90,7 +96,7 @@ bool DynamicLibrary::Load(const char* filename)
|
||||
}
|
||||
#endif
|
||||
library_file = filename;
|
||||
return true;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -29,14 +29,12 @@ class DynamicLibrary
|
||||
public:
|
||||
|
||||
DynamicLibrary();
|
||||
bool Load(const char* filename);
|
||||
int Load(const char* filename);
|
||||
void Unload();
|
||||
void* Get(const char* funcname) const;
|
||||
|
||||
|
||||
bool IsLoaded() const {return(library != 0);}
|
||||
|
||||
|
||||
private:
|
||||
std::string library_file;
|
||||
#ifdef _WIN32
|
||||
|
@ -15,6 +15,16 @@
|
||||
// Official SVN repository and contact information can be found at
|
||||
// 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"
|
||||
|
||||
namespace Common
|
||||
@ -24,7 +34,7 @@ DynamicLibrary CPlugin::m_hInstLib;
|
||||
void(__cdecl * CPlugin::m_GetDllInfo) (PLUGIN_INFO * _PluginInfo) = 0;
|
||||
//void(__cdecl * CPlugin::m_DllAbout) (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
|
||||
CPlugin::Release(void)
|
||||
@ -42,9 +52,9 @@ CPlugin::Load(const char* _szName)
|
||||
{
|
||||
if (m_hInstLib.Load(_szName))
|
||||
{
|
||||
m_GetDllInfo = (void (__cdecl*)(PLUGIN_INFO*))m_hInstLib.Get("GetDllInfo");
|
||||
m_DllConfig = (void (__cdecl*)(HWND))m_hInstLib.Get("DllConfig");
|
||||
m_DllDebugger = (void (__cdecl*)(HWND))m_hInstLib.Get("DllDebugger");
|
||||
m_GetDllInfo = (void (__cdecl*)(PLUGIN_INFO*)) m_hInstLib.Get("GetDllInfo");
|
||||
m_DllConfig = (void (__cdecl*)(HWND)) m_hInstLib.Get("DllConfig");
|
||||
m_DllDebugger = (void (__cdecl*)(HWND, bool)) m_hInstLib.Get("DllDebugger");
|
||||
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)
|
||||
{
|
||||
m_DllDebugger(_hwnd);
|
||||
m_DllDebugger(_hwnd, Show);
|
||||
}
|
||||
}
|
||||
} // end of namespace Common
|
||||
|
@ -35,7 +35,7 @@ class CPlugin
|
||||
|
||||
static void Config(HWND _hwnd);
|
||||
static void About(HWND _hwnd);
|
||||
static void Debug(HWND _hwnd);
|
||||
static void Debug(HWND _hwnd, bool Show);
|
||||
|
||||
|
||||
private:
|
||||
@ -44,7 +44,7 @@ class CPlugin
|
||||
|
||||
static void (__cdecl * m_GetDllInfo)(PLUGIN_INFO* _PluginInfo);
|
||||
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
|
||||
|
||||
|
@ -152,6 +152,7 @@ bool Init(const SCoreStartupParameter _CoreParameter)
|
||||
DisplayMessage("CPU: " + cpu_info.Summarize(), 8000);
|
||||
DisplayMessage(_CoreParameter.m_strFilename, 3000);
|
||||
|
||||
//PluginVideo::DllDebugger(NULL);
|
||||
|
||||
//RegisterPanicAlertHandler(PanicAlertToVideo);
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "Common.h"
|
||||
#include "DynamicLibrary.h"
|
||||
#include "Plugin_DSP.h"
|
||||
|
||||
@ -45,6 +46,11 @@ bool IsLoaded()
|
||||
return plugin.IsLoaded();
|
||||
}
|
||||
|
||||
void Debug(HWND _hwnd, bool Show)
|
||||
{
|
||||
DllDebugger(_hwnd, Show);
|
||||
}
|
||||
|
||||
void UnloadPlugin()
|
||||
{
|
||||
plugin.Unload();
|
||||
@ -68,7 +74,9 @@ void UnloadPlugin()
|
||||
|
||||
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"));
|
||||
DllConfig = reinterpret_cast<TDllConfig> (plugin.Get("DllConfig"));
|
||||
@ -97,7 +105,8 @@ bool LoadPlugin(const char *_Filename)
|
||||
(DSP_Update != 0) &&
|
||||
(DSP_SendAIBuffer != 0) &&
|
||||
(DSP_DoState != 0))
|
||||
{
|
||||
{
|
||||
//PanicAlert("return true: %i", ret);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@ -106,8 +115,13 @@ 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;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -30,7 +30,7 @@ void UnloadPlugin();
|
||||
typedef void (__cdecl* TGetDllInfo)(PLUGIN_INFO*);
|
||||
//typedef void (__cdecl* TDllAbout)(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_Shutdown)();
|
||||
typedef void (__cdecl* TDSP_WriteMailBox)(BOOL _CPUMailbox, unsigned short);
|
||||
|
@ -18,6 +18,9 @@
|
||||
#include "Common.h"
|
||||
#include "DynamicLibrary.h"
|
||||
#include "Plugin_Video.h"
|
||||
#include "Plugin.h"
|
||||
|
||||
extern DynamicLibrary Common::CPlugin;
|
||||
|
||||
namespace PluginVideo
|
||||
{
|
||||
@ -25,7 +28,7 @@ namespace PluginVideo
|
||||
// Function Pointer
|
||||
TGetDllInfo GetDllInfo = 0;
|
||||
TDllConfig DllConfig = 0;
|
||||
TDllDebugger DllDebugger = 0;
|
||||
TDllDebugger DllDebugger = 0;
|
||||
TVideo_Initialize Video_Initialize = 0;
|
||||
TVideo_Prepare Video_Prepare = 0;
|
||||
TVideo_Shutdown Video_Shutdown = 0;
|
||||
@ -36,10 +39,15 @@ TVideo_EnterLoop Video_EnterLoop = 0;
|
||||
TVideo_AddMessage Video_AddMessage = 0;
|
||||
TVideo_DoState Video_DoState = 0;
|
||||
TVideo_Stop Video_Stop = 0;
|
||||
|
||||
|
||||
// Library Instance
|
||||
DynamicLibrary plugin;
|
||||
|
||||
void Debug(HWND _hwnd, bool Show)
|
||||
{
|
||||
DllDebugger(_hwnd, Show);
|
||||
}
|
||||
|
||||
bool IsLoaded()
|
||||
{
|
||||
return plugin.IsLoaded();
|
||||
@ -47,6 +55,8 @@ bool IsLoaded()
|
||||
|
||||
void UnloadPlugin()
|
||||
{
|
||||
//PanicAlert("Video UnloadPlugin");
|
||||
|
||||
// set Functions to 0
|
||||
GetDllInfo = 0;
|
||||
DllConfig = 0;
|
||||
@ -65,7 +75,9 @@ void UnloadPlugin()
|
||||
|
||||
bool LoadPlugin(const char *_Filename)
|
||||
{
|
||||
if (plugin.Load(_Filename))
|
||||
int ret = plugin.Load(_Filename);
|
||||
|
||||
if (ret == 1)
|
||||
{
|
||||
GetDllInfo = reinterpret_cast<TGetDllInfo> (plugin.Get("GetDllInfo"));
|
||||
DllConfig = reinterpret_cast<TDllConfig> (plugin.Get("DllConfig"));
|
||||
@ -79,10 +91,11 @@ bool LoadPlugin(const char *_Filename)
|
||||
Video_EnterLoop = reinterpret_cast<TVideo_EnterLoop> (plugin.Get("Video_EnterLoop"));
|
||||
Video_AddMessage = reinterpret_cast<TVideo_AddMessage> (plugin.Get("Video_AddMessage"));
|
||||
Video_DoState = reinterpret_cast<TVideo_DoState> (plugin.Get("Video_DoState"));
|
||||
Video_Stop = reinterpret_cast<TVideo_Stop> (plugin.Get("Video_Stop"));
|
||||
Video_Stop = reinterpret_cast<TVideo_Stop> (plugin.Get("Video_Stop"));
|
||||
if ((GetDllInfo != 0) &&
|
||||
//(DllAbout != 0) &&
|
||||
(DllConfig != 0) &&
|
||||
(DllDebugger != 0) &&
|
||||
(Video_Initialize != 0) &&
|
||||
(Video_Prepare != 0) &&
|
||||
(Video_Shutdown != 0) &&
|
||||
@ -92,8 +105,9 @@ bool LoadPlugin(const char *_Filename)
|
||||
(Video_Screenshot != 0) &&
|
||||
(Video_AddMessage != 0) &&
|
||||
(Video_DoState != 0) &&
|
||||
(Video_Stop != 0))
|
||||
(Video_Stop != 0))
|
||||
{
|
||||
//PanicAlert("return true: %i", ret);
|
||||
return true;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,7 +34,7 @@ void UnloadPlugin();
|
||||
typedef void (__cdecl* TGetDllInfo)(PLUGIN_INFO*);
|
||||
//typedef void (__cdecl* TDllAbout)(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_Prepare)();
|
||||
typedef void (__cdecl* TVideo_Shutdown)();
|
||||
|
@ -64,6 +64,8 @@
|
||||
// and here are the classes
|
||||
class CPluginInfo;
|
||||
class CPluginManager;
|
||||
//extern DynamicLibrary Common::CPlugin;
|
||||
//extern CPluginManager CPluginManager::m_Instance;
|
||||
|
||||
extern "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?
|
||||
CPluginManager::GetInstance().OpenDebug(
|
||||
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
|
||||
|
||||
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?
|
||||
CPluginManager::GetInstance().OpenDebug(
|
||||
GetHandle(),
|
||||
_LocalCoreStartupParameter.m_strVideoPlugin.c_str()
|
||||
_LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
|
||||
true, true
|
||||
);
|
||||
} // don't have any else, just ignore it
|
||||
}
|
||||
@ -939,13 +946,19 @@ void CCodeWindow::OnToggleSoundWindow(wxCommandEvent& event)
|
||||
{
|
||||
// TODO: add some kind of if() check here to?
|
||||
CPluginManager::GetInstance().OpenDebug(
|
||||
GetHandle(),
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str()
|
||||
);
|
||||
GetHandle(),
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(),
|
||||
false, true // DSP, show
|
||||
);
|
||||
}
|
||||
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?
|
||||
CPluginManager::GetInstance().OpenDebug(
|
||||
GetHandle(),
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str()
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
|
||||
true, true // Video, show
|
||||
);
|
||||
}
|
||||
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
|
||||
);
|
||||
}
|
||||
}
|
||||
// ===========
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "Volume.h"
|
||||
#include "VolumeCreator.h"
|
||||
#include "Config.h"
|
||||
#include "ConfigMain.h"
|
||||
#include "Core.h"
|
||||
#if !defined(OSX64)
|
||||
#include "Frame.h"
|
||||
@ -89,9 +90,61 @@ bool BootCore(const std::string& _rFilename)
|
||||
std::string unique_id = StartUp.GetUniqueID();
|
||||
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", "SkipIdle", &StartUp.bSkipIdle, StartUp.bSkipIdle);
|
||||
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(main_frame)
|
||||
|
@ -64,7 +64,7 @@ CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title,
|
||||
|
||||
// Load Wii SYSCONF
|
||||
pStream = NULL;
|
||||
pStream = fopen(FULL_WII_USER_DIR "shared2/sys/SYSCONF", "rb");
|
||||
pStream = fopen(FULL_CONFIG_DIR "SYSCONF", "rb");
|
||||
if (pStream != NULL)
|
||||
{
|
||||
fread(m_SYSCONF, 1, 0x4000, pStream);
|
||||
@ -301,8 +301,19 @@ void CConfigMain::OnClose(wxCloseEvent& WXUNUSED (event))
|
||||
{
|
||||
Destroy();
|
||||
|
||||
// Save Wii SYSCONF
|
||||
// Save Wii SYSCONF twice so that we can keep game specific settings for it
|
||||
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");
|
||||
if (pStream != NULL)
|
||||
{
|
||||
@ -311,7 +322,7 @@ void CConfigMain::OnClose(wxCloseEvent& WXUNUSED (event))
|
||||
}
|
||||
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
|
||||
|
@ -93,6 +93,7 @@ EVT_MENU(IDM_CONFIG_MAIN, CFrame::OnConfigMain)
|
||||
EVT_MENU(IDM_CONFIG_GFX_PLUGIN, CFrame::OnPluginGFX)
|
||||
EVT_MENU(IDM_CONFIG_DSP_PLUGIN, CFrame::OnPluginDSP)
|
||||
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_MEMCARD, CFrame::OnMemcard)
|
||||
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_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_WIIMOTE_PLUGIN, _T("Wiimote"), m_Bitmaps[Toolbar_PluginPAD], _T("Wiimote settings"));
|
||||
toolBar->AddSeparator();
|
||||
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))
|
||||
{
|
||||
CPluginManager::GetInstance().OpenConfig(
|
||||
@ -488,7 +489,7 @@ void CFrame::OnPluginPAD(wxCommandEvent& WXUNUSED (event))
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin.c_str()
|
||||
);
|
||||
}
|
||||
void CFrame::OnPluginWiiMote(wxCommandEvent& WXUNUSED (event))
|
||||
void CFrame::OnPluginWiimote(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
CPluginManager::GetInstance().OpenConfig(
|
||||
GetHandle(),
|
||||
|
@ -64,7 +64,7 @@ class CFrame : public wxFrame
|
||||
void OnPluginGFX(wxCommandEvent& event);
|
||||
void OnPluginDSP(wxCommandEvent& event);
|
||||
void OnPluginPAD(wxCommandEvent& event);
|
||||
void OnPluginWiiMote(wxCommandEvent& event);
|
||||
void OnPluginWiimote(wxCommandEvent& event);
|
||||
void OnOpen(wxCommandEvent& event);
|
||||
void OnPlay(wxCommandEvent& event);
|
||||
void OnStop(wxCommandEvent& event);
|
||||
|
@ -57,6 +57,7 @@ enum
|
||||
IDM_CONFIG_GFX_PLUGIN,
|
||||
IDM_CONFIG_DSP_PLUGIN,
|
||||
IDM_CONFIG_PAD_PLUGIN,
|
||||
IDM_CONFIG_WIIMOTE_PLUGIN,
|
||||
IDM_TOGGLE_FULLSCREEN,
|
||||
IDM_TOGGLE_DUALCORE,
|
||||
IDM_TOGGLE_SKIPIDLE,
|
||||
|
@ -201,10 +201,13 @@ void CISOProperties::CreateGUIControls()
|
||||
// GameConfig editing - Core overrides and emulation state
|
||||
sbCoreOverrides = new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Game-Specific Settings"));
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
arrayStringFor_EmuState.Add(_("Not Set"));
|
||||
arrayStringFor_EmuState.Add(_("Broken"));
|
||||
@ -243,6 +246,8 @@ void CISOProperties::CreateGUIControls()
|
||||
sCoreOverrides->Add(UseDualCore, 0, wxEXPAND|wxLEFT, 5);
|
||||
sCoreOverrides->Add(SkipIdle, 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->Add(EmuStateText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);
|
||||
sEmuState->Add(EmuState, 0, wxEXPAND|wxALL, 0);
|
||||
@ -473,6 +478,16 @@ void CISOProperties::LoadGameConfig()
|
||||
else
|
||||
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);
|
||||
EmuState->SetSelection(iTemp);
|
||||
|
||||
@ -499,6 +514,16 @@ bool CISOProperties::SaveGameConfig(std::string GameIniFile)
|
||||
else
|
||||
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());
|
||||
return GameIni.Save(GameIniFile.c_str());
|
||||
|
||||
|
@ -73,6 +73,8 @@ class CISOProperties : public wxDialog
|
||||
wxCheckBox *UseDualCore;
|
||||
wxCheckBox *SkipIdle;
|
||||
wxCheckBox *OptimizeQuantizers;
|
||||
wxCheckBox *EnableProgressiveScan, *EnableWideScreen; // Wii
|
||||
|
||||
wxStaticText *EmuStateText;
|
||||
wxArrayString arrayStringFor_EmuState;
|
||||
wxChoice *EmuState;
|
||||
@ -131,6 +133,8 @@ class CISOProperties : public wxDialog
|
||||
ID_OVERRIDE_TEXT,
|
||||
ID_USEDUALCORE,
|
||||
ID_IDLESKIP,
|
||||
ID_ENABLEPROGRESSIVESCAN,
|
||||
ID_ENABLEWIDESCREEN,
|
||||
ID_OPTIMIZEQUANTIZERS,
|
||||
ID_EMUSTATE_TEXT,
|
||||
ID_EMUSTATE,
|
||||
|
@ -24,6 +24,28 @@
|
||||
#include "PluginManager.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;
|
||||
|
||||
|
||||
@ -35,6 +57,9 @@ CPluginManager::~CPluginManager()
|
||||
{}
|
||||
|
||||
|
||||
// ----------------------------------------
|
||||
// Create list of avaliable plugins
|
||||
// -------------
|
||||
void CPluginManager::ScanForPlugins(wxWindow* _wxWindow)
|
||||
{
|
||||
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)
|
||||
{
|
||||
if (Common::CPlugin::Load(_rFilename))
|
||||
{
|
||||
Common::CPlugin::Config((HWND)_Parent);
|
||||
Common::CPlugin::Release();
|
||||
}
|
||||
int ret = Common::CPlugin::Load(_rFilename);
|
||||
|
||||
Common::CPlugin::Config((HWND)_Parent);
|
||||
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))
|
||||
{
|
||||
Common::CPlugin::Debug((HWND)_Parent);
|
||||
//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);
|
||||
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)
|
||||
: m_FileName(_rFileName)
|
||||
, m_Valid(false)
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
static CPluginManager& GetInstance() {return(m_Instance);}
|
||||
void ScanForPlugins(wxWindow* _wxWindow);
|
||||
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);}
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user