nakee's work on dolphin events. Also get wxw out of logmanager. This commit wants your comments

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1875 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2009-01-15 06:48:15 +00:00
commit ba8c2aa7e4
83 changed files with 1293 additions and 1657 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"
@ -602,6 +602,38 @@
RelativePath=".\Src\Plugin.h" RelativePath=".\Src\Plugin.h"
> >
</File> </File>
<File
RelativePath=".\Src\PluginDSP.cpp"
>
</File>
<File
RelativePath=".\Src\PluginDSP.h"
>
</File>
<File
RelativePath=".\Src\PluginPAD.cpp"
>
</File>
<File
RelativePath=".\Src\PluginPAD.h"
>
</File>
<File
RelativePath=".\Src\PluginVideo.cpp"
>
</File>
<File
RelativePath=".\Src\PluginVideo.h"
>
</File>
<File
RelativePath=".\Src\PluginWiimote.cpp"
>
</File>
<File
RelativePath=".\Src\PluginWiimote.h"
>
</File>
<File <File
RelativePath=".\Src\SConscript" RelativePath=".\Src\SConscript"
> >

View file

@ -155,7 +155,7 @@ void* DynamicLibrary::Get(const char* funcname) const
if (!retval) if (!retval)
{ {
LOG(MASTER_LOG, "Symbol %s missing in %s (error: %s)\n", funcname, library_file.c_str(), GetLastErrorAsString().c_str()); LOG(MASTER_LOG, "Symbol %s missing in %s (error: %s)\n", funcname, library_file.c_str(), GetLastErrorAsString().c_str());
//PanicAlert("Symbol %s missing in %s (error: %s)\n", funcname, library_file.c_str(), GetLastErrorAsString().c_str()); PanicAlert("Symbol %s missing in %s (error: %s)\n", funcname, library_file.c_str(), GetLastErrorAsString().c_str());
} }
return retval; return retval;

View file

@ -29,44 +29,47 @@
namespace Common namespace Common
{ {
DynamicLibrary CPlugin::m_hInstLib;
void(__cdecl * CPlugin::m_GetDllInfo) (PLUGIN_INFO * _PluginInfo) = 0;
void(__cdecl * CPlugin::m_DllConfig) (HWND _hParent) = 0;
void(__cdecl * CPlugin::m_DllDebugger) (HWND _hParent, bool Show) = 0;
void(__cdecl * CPlugin::m_SetDllGlobals) (PLUGIN_GLOBALS* _PluginGlobals) = 0;
void
CPlugin::Release(void)
{
m_GetDllInfo = 0;
m_DllConfig = 0;
m_DllDebugger = 0;
m_SetDllGlobals = 0;
CPlugin::~CPlugin() {
m_hInstLib.Unload(); m_hInstLib.Unload();
} }
bool CPlugin::CPlugin(const char* _szName) : valid(false) {
CPlugin::Load(const char* _szName) if (m_hInstLib.Load(_szName)) {
{
if (m_hInstLib.Load(_szName)) m_GetDllInfo = reinterpret_cast<TGetDllInfo>
{ (m_hInstLib.Get("GetDllInfo"));
m_GetDllInfo = (void (__cdecl*)(PLUGIN_INFO*)) m_hInstLib.Get("GetDllInfo"); m_DllConfig = reinterpret_cast<TDllConfig>
m_DllConfig = (void (__cdecl*)(HWND)) m_hInstLib.Get("DllConfig"); (m_hInstLib.Get("DllConfig"));
m_DllDebugger = (void (__cdecl*)(HWND, bool)) m_hInstLib.Get("DllDebugger"); m_DllDebugger = reinterpret_cast<TDllDebugger>
m_SetDllGlobals = (void (__cdecl*)(PLUGIN_GLOBALS*)) m_hInstLib.Get("SetDllGlobals"); (m_hInstLib.Get("DllDebugger"));
return(true); m_SetDllGlobals = reinterpret_cast<TSetDllGlobals>
(m_hInstLib.Get("SetDllGlobals"));
m_Initialize = reinterpret_cast<TInitialize>
(m_hInstLib.Get("Initialize"));
m_Shutdown = reinterpret_cast<TShutdown>
(m_hInstLib.Get("Shutdown"));
m_DoState = reinterpret_cast<TDoState>
(m_hInstLib.Get("DoState"));
} }
return(false); if (m_GetDllInfo != 0 &&
m_DllConfig != 0 &&
m_DllDebugger != 0 &&
m_SetDllGlobals != 0 &&
m_Initialize != 0 &&
m_Shutdown != 0 &&
m_DoState != 0)
valid = true;
} }
void *CPlugin::LoadSymbol(const char *sym) {
return m_hInstLib.Get(sym);
}
bool CPlugin::GetInfo(PLUGIN_INFO& _pluginInfo) bool CPlugin::GetInfo(PLUGIN_INFO& _pluginInfo) {
{ if (m_GetDllInfo != 0) {
if (m_GetDllInfo != 0)
{
m_GetDllInfo(&_pluginInfo); m_GetDllInfo(&_pluginInfo);
return(true); return(true);
} }
@ -75,28 +78,37 @@ bool CPlugin::GetInfo(PLUGIN_INFO& _pluginInfo)
} }
void CPlugin::Config(HWND _hwnd) void CPlugin::Config(HWND _hwnd) {
{
if (m_DllConfig != 0) if (m_DllConfig != 0)
{
m_DllConfig(_hwnd); m_DllConfig(_hwnd);
}
} }
void CPlugin::Debug(HWND _hwnd, bool Show) void CPlugin::Debug(HWND _hwnd, bool Show) {
{
if (m_DllDebugger != 0) if (m_DllDebugger != 0)
{
m_DllDebugger(_hwnd, Show); m_DllDebugger(_hwnd, Show);
}
} }
void CPlugin::SetGlobals(PLUGIN_GLOBALS& _pluginGlobals) void CPlugin::SetGlobals(PLUGIN_GLOBALS* _pluginGlobals) {
{
if (m_SetDllGlobals != 0) if (m_SetDllGlobals != 0)
{ m_SetDllGlobals(_pluginGlobals);
m_SetDllGlobals(&_pluginGlobals);
} }
void CPlugin::DoState(unsigned char **ptr, int mode) {
if (m_DoState != 0)
m_DoState(ptr, mode);
}
void CPlugin::Initialize(void *init) {
if (m_Initialize != 0)
m_Initialize(init);
}
void CPlugin::Shutdown() {
if (m_Shutdown != 0)
m_Shutdown();
} }
} // end of namespace Common } // end of namespace Common

View file

@ -19,35 +19,52 @@
#define _PLUGIN_H #define _PLUGIN_H
#include "Common.h" #include "Common.h"
#include "../../../PluginSpecs/PluginSpecs.h" #include "PluginSpecs.h"
#include "DynamicLibrary.h" #include "DynamicLibrary.h"
namespace Common namespace Common
{ {
typedef void (__cdecl * TGetDllInfo)(PLUGIN_INFO*);
typedef void (__cdecl * TDllConfig)(HWND);
typedef void (__cdecl * TDllDebugger)(HWND, bool);
typedef void (__cdecl * TSetDllGlobals)(PLUGIN_GLOBALS*);
typedef void (__cdecl * TInitialize)(void *);
typedef void (__cdecl * TShutdown)();
typedef void (__cdecl * TDoState)(unsigned char**, int);
class CPlugin class CPlugin
{ {
public: public:
static void Release(void); CPlugin(const char* _szName);
static bool Load(const char* _szName); ~CPlugin();
static bool GetInfo(PLUGIN_INFO& _pluginInfo); virtual bool IsValid() {return valid;};
static void SetGlobals(PLUGIN_GLOBALS& _PluginGlobals);
static void Config(HWND _hwnd); bool GetInfo(PLUGIN_INFO& _pluginInfo);
static void About(HWND _hwnd); void SetGlobals(PLUGIN_GLOBALS* _PluginGlobals);
static void Debug(HWND _hwnd, bool Show); void *LoadSymbol(const char *sym);
void Config(HWND _hwnd);
void About(HWND _hwnd);
void Debug(HWND _hwnd, bool Show);
void DoState(unsigned char **ptr, int mode);
void Initialize(void *init);
void Shutdown();
private: private:
static DynamicLibrary m_hInstLib; DynamicLibrary m_hInstLib;
bool valid;
static void (__cdecl * m_GetDllInfo)(PLUGIN_INFO* _PluginInfo);
static void (__cdecl * m_DllConfig)(HWND _hParent);
static void (__cdecl * m_DllDebugger)(HWND _hParent, bool Show);
static void (__cdecl * m_SetDllGlobals)(PLUGIN_GLOBALS* _PluginGlobals);
// Functions
TGetDllInfo m_GetDllInfo;
TDllConfig m_DllConfig;
TDllDebugger m_DllDebugger;
TSetDllGlobals m_SetDllGlobals;
TInitialize m_Initialize;
TShutdown m_Shutdown;
TDoState m_DoState;
}; };
} // end of namespace Common } // end of namespace Common

View file

@ -0,0 +1,36 @@
#include "PluginDSP.h"
namespace Common {
PluginDSP::PluginDSP(const char *_Filename) : CPlugin(_Filename), validDSP(false) {
DSP_ReadMailboxHigh = reinterpret_cast<TDSP_ReadMailBox>
(LoadSymbol("DSP_ReadMailboxHigh"));
DSP_ReadMailboxLow = reinterpret_cast<TDSP_ReadMailBox>
(LoadSymbol("DSP_ReadMailboxLow"));
DSP_WriteMailboxHigh = reinterpret_cast<TDSP_WriteMailBox>
(LoadSymbol("DSP_WriteMailboxHigh"));
DSP_WriteMailboxLow = reinterpret_cast<TDSP_WriteMailBox>
(LoadSymbol("DSP_WriteMailboxLow"));
DSP_ReadControlRegister = reinterpret_cast<TDSP_ReadControlRegister>
(LoadSymbol("DSP_ReadControlRegister"));
DSP_WriteControlRegister = reinterpret_cast<TDSP_WriteControlRegister>
(LoadSymbol("DSP_WriteControlRegister"));
DSP_Update = reinterpret_cast<TDSP_Update>
(LoadSymbol("DSP_Update"));
DSP_SendAIBuffer = reinterpret_cast<TDSP_SendAIBuffer>
(LoadSymbol("DSP_SendAIBuffer"));
if ((DSP_ReadMailboxHigh != 0) &&
(DSP_ReadMailboxLow != 0) &&
(DSP_WriteMailboxHigh != 0) &&
(DSP_WriteMailboxLow != 0) &&
(DSP_ReadControlRegister != 0) &&
(DSP_WriteControlRegister != 0) &&
(DSP_SendAIBuffer != 0) &&
(DSP_Update != 0))
validDSP = true;
}
PluginDSP::~PluginDSP() {
}
}

View file

@ -0,0 +1,37 @@
#ifndef _PLUGINDSP_H
#define _PLUGINDSP_H
#include "pluginspecs_dsp.h"
#include "Plugin.h"
namespace Common {
typedef void (__cdecl* TDSP_WriteMailBox)(bool _CPUMailbox, unsigned short);
typedef unsigned short (__cdecl* TDSP_ReadMailBox)(bool _CPUMailbox);
typedef unsigned short (__cdecl* TDSP_ReadControlRegister)();
typedef unsigned short (__cdecl* TDSP_WriteControlRegister)(unsigned short);
typedef void (__cdecl* TDSP_SendAIBuffer)(unsigned int address, int sample_rate);
typedef void (__cdecl* TDSP_Update)(int cycles);
class PluginDSP : public CPlugin
{
public:
PluginDSP(const char *_Filename);
~PluginDSP();
virtual bool IsValid() {return validDSP;};
TDSP_ReadMailBox DSP_ReadMailboxHigh;
TDSP_ReadMailBox DSP_ReadMailboxLow;
TDSP_WriteMailBox DSP_WriteMailboxHigh;
TDSP_WriteMailBox DSP_WriteMailboxLow;
TDSP_ReadControlRegister DSP_ReadControlRegister;
TDSP_WriteControlRegister DSP_WriteControlRegister;
TDSP_SendAIBuffer DSP_SendAIBuffer;
TDSP_Update DSP_Update;
private:
bool validDSP;
};
}
#endif

View file

@ -0,0 +1,24 @@
#include "PluginPAD.h"
namespace Common {
PluginPAD::PluginPAD(const char *_Filename) : CPlugin(_Filename), validPAD(false) {
PAD_GetStatus = reinterpret_cast<TPAD_GetStatus>
(LoadSymbol("PAD_GetStatus"));
PAD_Input = reinterpret_cast<TPAD_Input>
(LoadSymbol("PAD_Input"));
PAD_Rumble = reinterpret_cast<TPAD_Rumble>
(LoadSymbol("PAD_Rumble"));
PAD_GetAttachedPads = reinterpret_cast<TPAD_GetAttachedPads>
(LoadSymbol("PAD_GetAttachedPads"));
if ((PAD_GetStatus != 0) &&
(PAD_Input != 0) &&
(PAD_Rumble != 0) &&
(PAD_GetAttachedPads != 0))
validPAD = true;
}
PluginPAD::~PluginPAD() {
}
}

View file

@ -0,0 +1,30 @@
#ifndef _PLUGINPAD_H
#define _PLUGINPAD_H
#include "pluginspecs_pad.h"
#include "Plugin.h"
namespace Common {
typedef void (__cdecl* TPAD_GetStatus)(u8, SPADStatus*);
typedef void (__cdecl* TPAD_Input)(u8, u8);
typedef void (__cdecl* TPAD_Rumble)(u8, unsigned int, unsigned int);
typedef unsigned int (__cdecl* TPAD_GetAttachedPads)();
class PluginPAD : public CPlugin {
public:
PluginPAD(const char *_Filename);
~PluginPAD();
virtual bool IsValid() {return validPAD;};
TPAD_GetStatus PAD_GetStatus;
TPAD_Input PAD_Input;
TPAD_Rumble PAD_Rumble;
TPAD_GetAttachedPads PAD_GetAttachedPads;
private:
bool validPAD;
};
}
#endif

View file

@ -0,0 +1,33 @@
#include "PluginVideo.h"
namespace Common {
PluginVideo::PluginVideo(const char *_Filename) : CPlugin(_Filename), validVideo(false) {
Video_Prepare = reinterpret_cast<TVideo_Prepare>
(LoadSymbol("Video_Prepare"));
Video_SendFifoData = reinterpret_cast<TVideo_SendFifoData>
(LoadSymbol("Video_SendFifoData"));
Video_UpdateXFB = reinterpret_cast<TVideo_UpdateXFB>
(LoadSymbol("Video_UpdateXFB"));
Video_Screenshot = reinterpret_cast<TVideo_Screenshot>
(LoadSymbol("Video_Screenshot"));
Video_EnterLoop = reinterpret_cast<TVideo_EnterLoop>
(LoadSymbol("Video_EnterLoop"));
Video_AddMessage = reinterpret_cast<TVideo_AddMessage>
(LoadSymbol("Video_AddMessage"));
Video_Stop = reinterpret_cast<TVideo_Stop>
(LoadSymbol("Video_Stop"));
if ((Video_Prepare != 0) &&
(Video_SendFifoData != 0) &&
(Video_UpdateXFB != 0) &&
(Video_EnterLoop != 0) &&
(Video_Screenshot != 0) &&
(Video_AddMessage != 0) &&
(Video_Stop != 0))
validVideo = true;
}
PluginVideo::~PluginVideo() {
}
}

View file

@ -0,0 +1,36 @@
#ifndef _PLUGINVIDEO_H
#define _PLUGINVIDEO_H
#include "pluginspecs_video.h"
#include "Plugin.h"
namespace Common {
typedef void (__cdecl* TVideo_Prepare)();
typedef void (__cdecl* TVideo_SendFifoData)(u8*,u32);
typedef void (__cdecl* TVideo_UpdateXFB)(u8*, u32, u32, s32);
typedef bool (__cdecl* TVideo_Screenshot)(const char* filename);
typedef void (__cdecl* TVideo_EnterLoop)();
typedef void (__cdecl* TVideo_AddMessage)(const char* pstr, unsigned int milliseconds);
typedef void (__cdecl* TVideo_Stop)();
class PluginVideo : public CPlugin {
public:
PluginVideo(const char *_Filename);
~PluginVideo();
virtual bool IsValid() {return validVideo;};
TVideo_Prepare Video_Prepare;
TVideo_SendFifoData Video_SendFifoData;
TVideo_UpdateXFB Video_UpdateXFB;
TVideo_Screenshot Video_Screenshot;
TVideo_EnterLoop Video_EnterLoop;
TVideo_AddMessage Video_AddMessage;
TVideo_Stop Video_Stop;
private:
bool validVideo;
};
}
#endif

View file

@ -0,0 +1,24 @@
#include "PluginWiimote.h"
namespace Common {
PluginWiimote::PluginWiimote(const char *_Filename) : CPlugin(_Filename), validWiimote(false) {
Wiimote_ControlChannel = reinterpret_cast<TWiimote_Output>
(LoadSymbol("Wiimote_ControlChannel"));
Wiimote_InterruptChannel = reinterpret_cast<TWiimote_Input>
(LoadSymbol("Wiimote_InterruptChannel"));
Wiimote_Update = reinterpret_cast<TWiimote_Update>
(LoadSymbol("Wiimote_Update"));
Wiimote_GetAttachedControllers = reinterpret_cast<TWiimote_GetAttachedControllers>
(LoadSymbol("Wiimote_GetAttachedControllers"));
if ((Wiimote_ControlChannel != 0) &&
(Wiimote_InterruptChannel != 0) &&
(Wiimote_Update != 0) &&
(Wiimote_GetAttachedControllers != 0))
validWiimote = true;
}
PluginWiimote::~PluginWiimote() {
}
}

View file

@ -0,0 +1,32 @@
#ifndef _PLUGINWIIMOTE_H
#define _PLUGINWIIMOTE_H
#include "pluginspecs_wiimote.h"
#include "Plugin.h"
namespace Common {
typedef unsigned int (__cdecl* TPAD_GetAttachedPads)();
typedef void (__cdecl* TWiimote_Update)();
typedef void (__cdecl* TWiimote_Output)(u16 _channelID, const void* _pData, u32 _Size);
typedef void (__cdecl* TWiimote_Input)(u16 _channelID, const void* _pData, u32 _Size);
typedef unsigned int (__cdecl* TWiimote_GetAttachedControllers)();
class PluginWiimote : public CPlugin {
public:
PluginWiimote(const char *_Filename);
~PluginWiimote();
virtual bool IsValid() {return validWiimote;};
TWiimote_Output Wiimote_ControlChannel;
TWiimote_Input Wiimote_InterruptChannel;
TWiimote_Update Wiimote_Update;
TWiimote_GetAttachedControllers Wiimote_GetAttachedControllers;
private:
bool validWiimote;
};
}
#endif

View file

@ -17,6 +17,10 @@ files = [
"MemArena.cpp", "MemArena.cpp",
"MemoryUtil.cpp", "MemoryUtil.cpp",
"Plugin.cpp", "Plugin.cpp",
"PluginDSP.cpp",
"PluginWiimote.cpp",
"PluginVideo.cpp",
"PluginPAD.cpp",
"StringUtil.cpp", "StringUtil.cpp",
"TestFramework.cpp", "TestFramework.cpp",
"Thunk.cpp", "Thunk.cpp",

View file

@ -20,21 +20,18 @@
#endif #endif
#include <time.h> #include <time.h>
#include <sys/timeb.h>
#include "Common.h" #include "Common.h"
#include "Timer.h" #include "Timer.h"
#ifdef __GNUC__ #ifdef __GNUC__
#include <sys/timeb.h>
u32 timeGetTime() u32 timeGetTime()
{ {
struct timeb t; struct timeb t;
ftime(&t); ftime(&t);
return((u32)(t.time * 1000 + t.millitm)); return((u32)(t.time * 1000 + t.millitm));
} }
#endif #endif
@ -88,7 +85,6 @@ void _time64(u64* t)
#endif #endif
u64 Timer::GetTimeSinceJan1970(void) u64 Timer::GetTimeSinceJan1970(void)
{ {
time_t ltime; time_t ltime;
@ -108,4 +104,14 @@ u64 Timer::GetLocalTimeSinceJan1970(void)
return (u64)(sysTime + tzDiff); return (u64)(sysTime + tzDiff);
} }
std::string Timer::GetTimeFormatted(void)
{
struct timeb tp;
(void)::ftime(&tp);
char temp[32];
sprintf(temp, "%02hi:%02i:%03i", tp.time/60, tp.time%60, tp.millitm);
return std::string(temp);
}
} // end of namespace Common } // end of namespace Common

View file

@ -39,6 +39,8 @@ class Timer
static u64 GetTimeSinceJan1970(); static u64 GetTimeSinceJan1970();
static u64 GetLocalTimeSinceJan1970(); static u64 GetLocalTimeSinceJan1970();
static std::string GetTimeFormatted();
public: public:

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="Core" Name="Core"
ProjectGUID="{F0B874CB-4476-4199-9315-8343D05AE684}" ProjectGUID="{F0B874CB-4476-4199-9315-8343D05AE684}"
RootNamespace="Core" RootNamespace="Core"
@ -45,7 +45,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\Core\InputCommon\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\..\..\Externals\LZO;..\Common\Src;..\DiscIO\Src;..\..\PluginSpecs;..\Debugger\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib" AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
@ -116,7 +116,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\Core\InputCommon\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\..\..\Externals\LZO;..\Common\Src;..\DiscIO\Src;..\..\PluginSpecs;..\Debugger\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib" AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
@ -191,7 +191,7 @@
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="true" OmitFramePointers="true"
EnableFiberSafeOptimizations="false" EnableFiberSafeOptimizations="false"
AdditionalIncludeDirectories="..\..\Core\InputCommon\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\..\..\Externals\LZO;..\Common\Src;..\DiscIO\Src;..\..\PluginSpecs;..\Debugger\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib" AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
StringPooling="true" StringPooling="true"
RuntimeLibrary="0" RuntimeLibrary="0"
@ -268,7 +268,7 @@
OmitFramePointers="true" OmitFramePointers="true"
EnableFiberSafeOptimizations="false" EnableFiberSafeOptimizations="false"
WholeProgramOptimization="false" WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\..\Core\InputCommon\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\..\..\Externals\LZO;..\Common\Src;..\DiscIO\Src;..\..\PluginSpecs;..\Debugger\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib" AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
StringPooling="true" StringPooling="true"
RuntimeLibrary="0" RuntimeLibrary="0"
@ -343,7 +343,7 @@
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="true" OmitFramePointers="true"
EnableFiberSafeOptimizations="false" EnableFiberSafeOptimizations="false"
AdditionalIncludeDirectories="..\..\Core\InputCommon\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\..\..\Externals\LZO;..\Common\Src;..\DiscIO\Src;..\..\PluginSpecs;..\Debugger\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib" AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib"
PreprocessorDefinitions="NDEBUG;_LIB;DEBUGFAST;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" PreprocessorDefinitions="NDEBUG;_LIB;DEBUGFAST;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
RuntimeLibrary="0" RuntimeLibrary="0"
BufferSecurityCheck="true" BufferSecurityCheck="true"
@ -418,7 +418,7 @@
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="true" OmitFramePointers="true"
EnableFiberSafeOptimizations="false" EnableFiberSafeOptimizations="false"
AdditionalIncludeDirectories="..\..\Core\InputCommon\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\..\..\Externals\LZO;..\Common\Src;..\DiscIO\Src;..\..\PluginSpecs;..\Debugger\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib" AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib"
PreprocessorDefinitions="NDEBUG;_LIB;DEBUGFAST;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" PreprocessorDefinitions="NDEBUG;_LIB;DEBUGFAST;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
RuntimeLibrary="0" RuntimeLibrary="0"
BufferSecurityCheck="false" BufferSecurityCheck="false"
@ -772,74 +772,6 @@
</File> </File>
</Filter> </Filter>
</Filter> </Filter>
<Filter
Name="Plugins"
>
<File
RelativePath=".\Src\Plugins\Plugin_DSP.cpp"
>
</File>
<File
RelativePath=".\Src\Plugins\Plugin_DSP.h"
>
</File>
<File
RelativePath=".\Src\Plugins\Plugin_PAD.cpp"
>
</File>
<File
RelativePath=".\Src\Plugins\Plugin_PAD.h"
>
</File>
<File
RelativePath=".\Src\Plugins\Plugin_Video.cpp"
>
</File>
<File
RelativePath=".\Src\Plugins\Plugin_Video.h"
>
</File>
<File
RelativePath=".\Src\Plugins\Plugin_Wiimote.cpp"
>
</File>
<File
RelativePath=".\Src\Plugins\Plugin_Wiimote.h"
>
</File>
<Filter
Name="Specs"
>
<File
RelativePath="..\..\PluginSpecs\CommonTypes.h"
>
</File>
<File
RelativePath="..\..\PluginSpecs\ExportProlog.h"
>
</File>
<File
RelativePath="..\..\PluginSpecs\PluginSpecs.h"
>
</File>
<File
RelativePath="..\..\PluginSpecs\pluginspecs_dsp.h"
>
</File>
<File
RelativePath="..\..\PluginSpecs\pluginspecs_pad.h"
>
</File>
<File
RelativePath="..\..\PluginSpecs\pluginspecs_video.h"
>
</File>
<File
RelativePath="..\..\PluginSpecs\pluginspecs_wiimote.h"
>
</File>
</Filter>
</Filter>
<Filter <Filter
Name="PowerPC" Name="PowerPC"
> >

View file

@ -40,7 +40,7 @@
#include "PeripheralInterface.h" #include "PeripheralInterface.h"
#include "AudioInterface.h" #include "AudioInterface.h"
#include "../PowerPC/PowerPC.h" #include "../PowerPC/PowerPC.h"
#include "../Plugins/Plugin_DSP.h" #include "../PluginManager.h"
namespace DSP namespace DSP
{ {
@ -233,31 +233,31 @@ void Read16(u16& _uReturnValue, const u32 _iAddress)
if (_iAddress != 0xCC005004) { if (_iAddress != 0xCC005004) {
LOGV(DSPINTERFACE, 3, "DSPInterface(r16) 0x%08x", _iAddress); LOGV(DSPINTERFACE, 3, "DSPInterface(r16) 0x%08x", _iAddress);
} }
Common::PluginDSP *dsp = CPluginManager::GetInstance().GetDSP();
switch (_iAddress & 0xFFFF) switch (_iAddress & 0xFFFF)
{ {
// ================================================================================== // ==================================================================================
// AI_REGS 0x5000+ // AI_REGS 0x5000+
// ================================================================================== // ==================================================================================
case DSP_MAIL_TO_DSP_HI: case DSP_MAIL_TO_DSP_HI:
_uReturnValue = PluginDSP::DSP_ReadMailboxHigh(true); _uReturnValue = dsp->DSP_ReadMailboxHigh(true);
return; return;
case DSP_MAIL_TO_DSP_LO: case DSP_MAIL_TO_DSP_LO:
_uReturnValue = PluginDSP::DSP_ReadMailboxLow(true); _uReturnValue = dsp->DSP_ReadMailboxLow(true);
return; return;
case DSP_MAIL_FROM_DSP_HI: case DSP_MAIL_FROM_DSP_HI:
_uReturnValue = PluginDSP::DSP_ReadMailboxHigh(false); _uReturnValue = dsp->DSP_ReadMailboxHigh(false);
return; return;
case DSP_MAIL_FROM_DSP_LO: case DSP_MAIL_FROM_DSP_LO:
_uReturnValue = PluginDSP::DSP_ReadMailboxLow(false); _uReturnValue = dsp->DSP_ReadMailboxLow(false);
return; return;
case DSP_CONTROL: case DSP_CONTROL:
_uReturnValue = (g_dspState.DSPControl.Hex & ~DSP_CONTROL_MASK) | _uReturnValue = (g_dspState.DSPControl.Hex & ~DSP_CONTROL_MASK) |
(PluginDSP::DSP_ReadControlRegister() & DSP_CONTROL_MASK); (dsp->DSP_ReadControlRegister() & DSP_CONTROL_MASK);
return; return;
// ================================================================================== // ==================================================================================
@ -317,7 +317,7 @@ void Read16(u16& _uReturnValue, const u32 _iAddress)
void Write16(const u16 _Value, const u32 _Address) void Write16(const u16 _Value, const u32 _Address)
{ {
LOGV(DSPINTERFACE, 3, "DSPInterface(w16) 0x%04x 0x%08x", _Value, _Address); LOGV(DSPINTERFACE, 3, "DSPInterface(w16) 0x%04x 0x%08x", _Value, _Address);
Common::PluginDSP *dsp = CPluginManager::GetInstance().GetDSP();
switch(_Address & 0xFFFF) switch(_Address & 0xFFFF)
{ {
// ================================================================================== // ==================================================================================
@ -325,11 +325,11 @@ void Write16(const u16 _Value, const u32 _Address)
// ================================================================================== // ==================================================================================
case DSP_MAIL_TO_DSP_HI: case DSP_MAIL_TO_DSP_HI:
PluginDSP::DSP_WriteMailboxHigh(true, _Value); dsp->DSP_WriteMailboxHigh(true, _Value);
break; break;
case DSP_MAIL_TO_DSP_LO: case DSP_MAIL_TO_DSP_LO:
PluginDSP::DSP_WriteMailboxLow(true, _Value); dsp->DSP_WriteMailboxLow(true, _Value);
break; break;
case DSP_MAIL_FROM_DSP_HI: case DSP_MAIL_FROM_DSP_HI:
@ -347,7 +347,7 @@ void Write16(const u16 _Value, const u32 _Address)
{ {
UDSPControl tmpControl; UDSPControl tmpControl;
tmpControl.Hex = (_Value& ~DSP_CONTROL_MASK) | tmpControl.Hex = (_Value& ~DSP_CONTROL_MASK) |
(PluginDSP::DSP_WriteControlRegister(_Value) & DSP_CONTROL_MASK); (dsp->DSP_WriteControlRegister(_Value) & DSP_CONTROL_MASK);
// Update DSP related flags // Update DSP related flags
g_dspState.DSPControl.DSPReset = tmpControl.DSPReset; g_dspState.DSPControl.DSPReset = tmpControl.DSPReset;
@ -462,9 +462,9 @@ void UpdateAudioDMA()
if (g_audioDMA.AudioDMAControl.Enabled && g_audioDMA.BlocksLeft) { if (g_audioDMA.AudioDMAControl.Enabled && g_audioDMA.BlocksLeft) {
// Read audio at g_audioDMA.ReadAddress in RAM and push onto an external audio fifo in the emulator, // Read audio at g_audioDMA.ReadAddress in RAM and push onto an external audio fifo in the emulator,
// to be mixed with the disc streaming output. If that audio queue fills up, we delay the emulator. // to be mixed with the disc streaming output. If that audio queue fills up, we delay the emulator.
Common::PluginDSP *dsp = CPluginManager::GetInstance().GetDSP();
// TO RESTORE OLD BEHAVIOUR, COMMENT OUT THIS LINE // TO RESTORE OLD BEHAVIOUR, COMMENT OUT THIS LINE
PluginDSP::DSP_SendAIBuffer(g_audioDMA.ReadAddress, AudioInterface::GetDSPSampleRate()); dsp->DSP_SendAIBuffer(g_audioDMA.ReadAddress, AudioInterface::GetDSPSampleRate());
g_audioDMA.ReadAddress += 32; g_audioDMA.ReadAddress += 32;
g_audioDMA.BlocksLeft--; g_audioDMA.BlocksLeft--;

View file

@ -33,7 +33,7 @@
#include "AudioInterface.h" #include "AudioInterface.h"
#include "VideoInterface.h" #include "VideoInterface.h"
#include "WII_IPC.h" #include "WII_IPC.h"
#include "../Plugins/Plugin_Video.h" #include "../PluginManager.h"
#include "../CoreTiming.h" #include "../CoreTiming.h"
#include "SystemTimers.h" #include "SystemTimers.h"
#include "../IPC_HLE/WII_IPC_HLE.h" #include "../IPC_HLE/WII_IPC_HLE.h"

View file

@ -20,7 +20,7 @@
#include "PeripheralInterface.h" #include "PeripheralInterface.h"
#include "../Plugins/Plugin_PAD.h" #include "../PluginManager.h"
#include "SI.h" #include "SI.h"
#include "SI_Device.h" #include "SI_Device.h"
@ -238,7 +238,14 @@ void Init()
g_Channel[i].m_InLo.Hex = 0; g_Channel[i].m_InLo.Hex = 0;
} }
unsigned int AttachedPadMask = PluginPAD::PAD_GetAttachedPads ? PluginPAD::PAD_GetAttachedPads() : 1; Common::PluginPAD* pad = CPluginManager::GetInstance().GetPAD(0);
unsigned int AttachedPadMask;
if (pad != NULL)
AttachedPadMask = pad->PAD_GetAttachedPads();
else
AttachedPadMask = 1;
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
if (AttachedPadMask & (1 << i)) if (AttachedPadMask & (1 << i))

View file

@ -20,7 +20,7 @@
#include "SI_Device.h" #include "SI_Device.h"
#include "SI_DeviceGCController.h" #include "SI_DeviceGCController.h"
#include "../Plugins/Plugin_PAD.h" #include "../PluginManager.h"
#include "EXI_Device.h" #include "EXI_Device.h"
#include "EXI_DeviceMic.h" #include "EXI_DeviceMic.h"
@ -119,7 +119,8 @@ CSIDevice_GCController::GetData(u32& _Hi, u32& _Low)
{ {
SPADStatus PadStatus; SPADStatus PadStatus;
memset(&PadStatus, 0 ,sizeof(PadStatus)); memset(&PadStatus, 0 ,sizeof(PadStatus));
PluginPAD::PAD_GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus); Common::PluginPAD* pad = CPluginManager::GetInstance().GetPAD(0);
pad->PAD_GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus);
_Hi = (u32)((u8)PadStatus.stickY); _Hi = (u32)((u8)PadStatus.stickY);
_Hi |= (u32)((u8)PadStatus.stickX << 8); _Hi |= (u32)((u8)PadStatus.stickX << 8);
@ -145,7 +146,9 @@ CSIDevice_GCController::GetData(u32& _Hi, u32& _Low)
void void
CSIDevice_GCController::SendCommand(u32 _Cmd) CSIDevice_GCController::SendCommand(u32 _Cmd)
{ {
Common::PluginPAD* pad = CPluginManager::GetInstance().GetPAD(0);
UCommand command(_Cmd); UCommand command(_Cmd);
switch(command.Command) switch(command.Command)
{ {
// Costis sent it in some demos :) // Costis sent it in some demos :)
@ -156,8 +159,8 @@ CSIDevice_GCController::SendCommand(u32 _Cmd)
{ {
unsigned int uType = command.Parameter1; // 0 = stop, 1 = rumble, 2 = stop hard unsigned int uType = command.Parameter1; // 0 = stop, 1 = rumble, 2 = stop hard
unsigned int uStrength = command.Parameter2; unsigned int uStrength = command.Parameter2;
if (PluginPAD::PAD_Rumble) if (pad->PAD_Rumble)
PluginPAD::PAD_Rumble(ISIDevice::m_iDeviceNumber, uType, uStrength); pad->PAD_Rumble(ISIDevice::m_iDeviceNumber, uType, uStrength);
} }
break; break;

View file

@ -17,7 +17,7 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// File description: This file control all system timers // File description: This file controls all system timers
/* ------------- /* -------------
"Time" is measured in frames, not time: These update frequencies are determined by the passage "Time" is measured in frames, not time: These update frequencies are determined by the passage
of frames. So if a game runs slow, on a slow computer for example, these updates will occur of frames. So if a game runs slow, on a slow computer for example, these updates will occur
@ -63,8 +63,7 @@
#include "Common.h" #include "Common.h"
#include "../PatchEngine.h" #include "../PatchEngine.h"
#include "SystemTimers.h" #include "SystemTimers.h"
#include "../Plugins/Plugin_DSP.h" #include "../PluginManager.h"
#include "../Plugins/Plugin_Video.h"
#include "../HW/DSP.h" #include "../HW/DSP.h"
#include "../HW/AudioInterface.h" #include "../HW/AudioInterface.h"
#include "../HW/VideoInterface.h" #include "../HW/VideoInterface.h"
@ -160,7 +159,7 @@ void AICallback(u64 userdata, int cyclesLate)
void DSPCallback(u64 userdata, int cyclesLate) void DSPCallback(u64 userdata, int cyclesLate)
{ {
// ~1/6th as many cycles as the period PPC-side. // ~1/6th as many cycles as the period PPC-side.
PluginDSP::DSP_Update(DSP_PERIOD / 6); CPluginManager::GetInstance().GetDSP()->DSP_Update(DSP_PERIOD / 6);
CoreTiming::ScheduleEvent(DSP_PERIOD-cyclesLate, et_DSP); CoreTiming::ScheduleEvent(DSP_PERIOD-cyclesLate, et_DSP);
} }

View file

@ -23,7 +23,7 @@
#include "PeripheralInterface.h" #include "PeripheralInterface.h"
#include "VideoInterface.h" #include "VideoInterface.h"
#include "Memmap.h" #include "Memmap.h"
#include "../Plugins/Plugin_Video.h" #include "../PluginManager.h"
#include "../CoreTiming.h" #include "../CoreTiming.h"
#include "../HW/SystemTimers.h" #include "../HW/SystemTimers.h"
@ -532,12 +532,12 @@ void Update()
xfbPtr = Memory::GetPointer(addr); xfbPtr = Memory::GetPointer(addr);
yOffset = -1; yOffset = -1;
} }
Common::PluginVideo* video = CPluginManager::GetInstance().GetVideo();
if (xfbPtr && PluginVideo::IsLoaded()) if (xfbPtr && video->IsValid())
{ {
int fbWidth = m_VIHorizontalStepping.FieldSteps * 16; int fbWidth = m_VIHorizontalStepping.FieldSteps * 16;
int fbHeight = (m_VIHorizontalStepping.FbSteps / m_VIHorizontalStepping.FieldSteps) * m_VIVerticalTimingRegister.ACV; int fbHeight = (m_VIHorizontalStepping.FbSteps / m_VIHorizontalStepping.FieldSteps) * m_VIVerticalTimingRegister.ACV;
PluginVideo::Video_UpdateXFB(xfbPtr, fbWidth, fbHeight, yOffset); video->Video_UpdateXFB(xfbPtr, fbWidth, fbHeight, yOffset);
} }
} }
@ -558,4 +558,3 @@ void Update()
} }
} }

View file

@ -20,7 +20,7 @@
// Include // Include
// ¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯
#include "WII_IPC_HLE_Device_usb.h" #include "WII_IPC_HLE_Device_usb.h"
#include "../Plugins/Plugin_Wiimote.h" #include "../PluginManager.h"
#include "../Core.h" // Local core functions #include "../Core.h" // Local core functions
#include "../Debugger/Debugger_SymbolMap.h" #include "../Debugger/Debugger_SymbolMap.h"
@ -392,7 +392,7 @@ u32 CWII_IPC_HLE_Device_usb_oh1_57e_305::Update()
if (m_AclFrameQue.empty()) if (m_AclFrameQue.empty())
{ {
PluginWiimote::Wiimote_Update(); CPluginManager::GetInstance().GetWiimote(0)->Wiimote_Update();
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------

View file

@ -20,7 +20,7 @@
#include "WII_IPC_HLE_WiiMote.h" // Core #include "WII_IPC_HLE_WiiMote.h" // Core
#include "WII_IPC_HLE_Device_usb.h" #include "WII_IPC_HLE_Device_usb.h"
#include "../Plugins/Plugin_Wiimote.h" #include "../PluginManager.h"
#include "../Host.h" #include "../Host.h"
#include "../Core.h" #include "../Core.h"
@ -349,6 +349,7 @@ void CWII_IPC_HLE_WiiMote::SendACLFrame(u8* _pData, u32 _Size)
{ {
_dbg_assert_msg_(WII_IPC_WIIMOTE, DoesChannelExist(pHeader->CID), "SendACLFrame to unknown channel %i", pHeader->CID); _dbg_assert_msg_(WII_IPC_WIIMOTE, DoesChannelExist(pHeader->CID), "SendACLFrame to unknown channel %i", pHeader->CID);
CChannelMap::iterator itr= m_Channel.find(pHeader->CID); CChannelMap::iterator itr= m_Channel.find(pHeader->CID);
Common::PluginWiimote* mote = CPluginManager::GetInstance().GetWiimote(0);
if (itr != m_Channel.end()) if (itr != m_Channel.end())
{ {
SChannel& rChannel = itr->second; SChannel& rChannel = itr->second;
@ -359,12 +360,12 @@ void CWII_IPC_HLE_WiiMote::SendACLFrame(u8* _pData, u32 _Size)
break; break;
case HIDP_CONTROL_CHANNEL: case HIDP_CONTROL_CHANNEL:
PluginWiimote::Wiimote_ControlChannel(rChannel.DCID, pData, DataSize); mote->Wiimote_ControlChannel(rChannel.DCID, pData, DataSize);
break; break;
case HID_INTERRUPT_CHANNEL: case HID_INTERRUPT_CHANNEL:
ShowStatus(pData); ShowStatus(pData);
PluginWiimote::Wiimote_InterruptChannel(rChannel.DCID, pData, DataSize); mote->Wiimote_InterruptChannel(rChannel.DCID, pData, DataSize);
break; break;
default: default:

View file

@ -29,10 +29,6 @@
#include "PowerPC/PowerPC.h" // Core #include "PowerPC/PowerPC.h" // Core
#include "PowerPC/SymbolDB.h" // for g_symbolDB #include "PowerPC/SymbolDB.h" // for g_symbolDB
#include "Debugger/Debugger_SymbolMap.h" #include "Debugger/Debugger_SymbolMap.h"
#if defined(HAVE_WX) && HAVE_WX && defined(WX_CORE) // wxWidgets
#include <wx/datetime.h> // for the timestamps
#endif
///////////////////////// /////////////////////////
@ -243,9 +239,6 @@ void LogManager::Log(LogTypes::LOG_TYPE _type, const char *_fmt, ...)
static u32 count = 0; static u32 count = 0;
char* Msg2 = (char*)alloca(strlen(_fmt)+512); char* Msg2 = (char*)alloca(strlen(_fmt)+512);
#if defined(HAVE_WX) && HAVE_WX && defined(WX_CORE)
wxDateTime datetime = wxDateTime::UNow(); // get timestamp
#endif
// Here's the old symbol request // Here's the old symbol request
//Debugger::FindSymbol(PC); //Debugger::FindSymbol(PC);
@ -277,17 +270,9 @@ void LogManager::Log(LogTypes::LOG_TYPE _type, const char *_fmt, ...)
const char *eol = "\n"; const char *eol = "\n";
if (Index > 0) if (Index > 0)
{ {
#if defined(HAVE_WX) && HAVE_WX && defined(WX_CORE) sprintf(Msg2, "%i %s: %x %s (%s, %08x) : %s%s",
sprintf(Msg2, "%i %02i:%02i:%03i: %x %s (%s, %08x) : %s%s",
#else
sprintf(Msg2, "%i %llu: %x %s (%s, %08x) : %s%s",
#endif
++count, ++count,
#if defined(HAVE_WX) && HAVE_WX && defined(WX_CORE) Common::Timer::GetTimeFormatted().c_str(),
datetime.GetMinute(), datetime.GetSecond(), datetime.GetMillisecond(),
#else
Common::Timer::GetTimeSinceJan1970(),
#endif
PowerPC::ppcState.DebugCount, PowerPC::ppcState.DebugCount,
m_Log[_type]->m_szShortName_, // (CONSOLE etc) m_Log[_type]->m_szShortName_, // (CONSOLE etc)
symbol.c_str(), PC, // current PC location (name, address) symbol.c_str(), PC, // current PC location (name, address)

View file

@ -24,38 +24,85 @@
#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;
CPluginManager::CPluginManager() CPluginManager::CPluginManager()
{} {
m_PluginGlobals = new PLUGIN_GLOBALS;
m_PluginGlobals->eventHandler = EventHandler::GetInstance();
m_PluginGlobals->config = NULL;
m_PluginGlobals->messageLogger = NULL;
}
CPluginManager::~CPluginManager() CPluginManager::~CPluginManager()
{} {
if (m_PluginGlobals)
delete m_PluginGlobals;
if (m_dsp)
delete m_dsp;
if (m_video)
delete m_video;
for (int i=0;i<1;i++) {
if (m_pad[i])
delete m_pad[i];
if (m_wiimote[i])
delete m_wiimote[i];
}
}
bool CPluginManager::InitPlugins(SCoreStartupParameter scsp) {
// TODO error checking
m_dsp = (Common::PluginDSP*)LoadPlugin(scsp.m_strDSPPlugin.c_str());
if (!m_dsp) {
return false;
}
m_video = (Common::PluginVideo*)LoadPlugin(scsp.m_strVideoPlugin.c_str());
if (!m_video)
return false;
for (int i=0;i<1;i++) {
m_pad[i] = (Common::PluginPAD*)LoadPlugin(scsp.m_strPadPlugin.c_str());
if (m_pad[i] == NULL)
return false;
if (scsp.bWii) {
m_wiimote[i] = (Common::PluginWiimote*)LoadPlugin
(scsp.m_strWiimotePlugin.c_str());
if (m_wiimote[i] == NULL)
return false;
}
}
return true;
}
void CPluginManager::ShutdownPlugins() {
for (int i=0;i<1;i++) {
if (m_pad[i])
m_pad[i]->Shutdown();
if (m_wiimote[i])
m_wiimote[i]->Shutdown();
}
if (m_video)
m_video->Shutdown();
if (m_dsp)
m_dsp->Shutdown();
}
PLUGIN_GLOBALS* CPluginManager::GetGlobals() {
return m_PluginGlobals;
}
// ---------------------------------------- // ----------------------------------------
// Create list of available plugins // Create list of available plugins
@ -95,40 +142,119 @@ void CPluginManager::ScanForPlugins()
} }
} }
Common::PluginPAD *CPluginManager::GetPAD(int controller) {
// if (m_pad[controller] == NULL)
// InitPlugins();
return m_pad[controller];
}
Common::PluginWiimote *CPluginManager::GetWiimote(int controller) {
// if (m_wiimote[controller] == NULL)
// InitPlugins();
return m_wiimote[controller];
}
Common::PluginDSP *CPluginManager::GetDSP() {
// if (m_dsp == NULL)
// InitPlugins();
return m_dsp;
}
Common::PluginVideo *CPluginManager::GetVideo() {
// if (m_video == NULL)
// InitPlugins();
return m_video;
}
void *CPluginManager::LoadPlugin(const char *_rFilename)//, PLUGIN_TYPE type)
{
CPluginInfo info(_rFilename);
PLUGIN_TYPE type = info.GetPluginInfo().Type;
Common::CPlugin *plugin = NULL;
switch (type) {
case PLUGIN_TYPE_VIDEO:
plugin = new Common::PluginVideo(_rFilename);
break;
case PLUGIN_TYPE_PAD:
plugin = new Common::PluginPAD(_rFilename);
break;
case PLUGIN_TYPE_DSP:
plugin = new Common::PluginDSP(_rFilename);
break;
case PLUGIN_TYPE_WIIMOTE:
plugin = new Common::PluginWiimote(_rFilename);
break;
default:
PanicAlert("Trying to load unsupported type %d", type);
}
if (!plugin->IsValid()) {
PanicAlert("Can't open %s", _rFilename);
return NULL;
}
plugin->SetGlobals(m_PluginGlobals);
return plugin;
}
// ---------------------------------------- // ----------------------------------------
// Open config window. _rFilename = plugin filename ,ret = the dll slot number // 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)
{ {
Common::CPlugin::Load(_rFilename);
Common::CPlugin::Config((HWND)_Parent); Common::CPlugin *plugin = new Common::CPlugin(_rFilename);
Common::CPlugin::Release(); plugin->SetGlobals(m_PluginGlobals);
plugin->Config((HWND)_Parent);
delete plugin;
} }
// ---------------------------------------- // ----------------------------------------
// Open debugging window. Type = Video or DSP. Show = Show or hide window. // Open debugging window. Type = Video or DSP. Show = Show or hide window.
// ------------- // -------------
void CPluginManager::OpenDebug(void* _Parent, const char *_rFilename, bool Type, bool Show) void CPluginManager::OpenDebug(void* _Parent, const char *_rFilename, PLUGIN_TYPE Type, bool Show)
{ {
//int ret = 1; //int ret = 1;
//int ret = Common::CPlugin::Load(_rFilename, true); //int ret = Common::CPlugin::Load(_rFilename, true);
//int ret = PluginVideo::LoadPlugin(_rFilename); //int ret = PluginVideo::LoadPlugin(_rFilename);
//int ret = PluginDSP::LoadPlugin(_rFilename); //int ret = PluginDSP::LoadPlugin(_rFilename);
if (Type)
if (Type == PLUGIN_TYPE_VIDEO) {
if(!m_video)
m_video = (Common::PluginVideo*)LoadPlugin(_rFilename);
m_video->Debug((HWND)_Parent, Show);
} else if (Type == PLUGIN_TYPE_DSP) {
if (!m_dsp)
m_dsp = (Common::PluginDSP*)LoadPlugin(_rFilename);
m_dsp->Debug((HWND)_Parent, Show);
}
/* if (Type)
{ {
//Common::CPlugin::Debug((HWND)_Parent); //Common::CPlugin::Debug((HWND)_Parent);
if (!PluginVideo::IsLoaded()) if (!PluginVideo::IsLoaded())
PluginVideo::LoadPlugin(_rFilename); PluginVideo::LoadPlugin(_rFilename);
//PluginVideo::SetDllGlobals(m_PluginGlobals);
PluginVideo::Debug((HWND)_Parent, Show); PluginVideo::Debug((HWND)_Parent, Show);
} }
else else
{ {
if(!PluginDSP::IsLoaded()) PluginDSP::LoadPlugin(_rFilename); if(!PluginDSP::IsLoaded())
PluginDSP::LoadPlugin(_rFilename);
//PluginDSP::SetDllGlobals(m_PluginGlobals);
PluginDSP::Debug((HWND)_Parent, Show); PluginDSP::Debug((HWND)_Parent, Show);
} }*/
//Common::CPlugin::Release(); // this is only if the wx dialog is called with ShowModal() //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 = (void (__cdecl*)(HWND))PluginVideo::plugin.Get("DllDebugger");
@ -142,14 +268,15 @@ CPluginInfo::CPluginInfo(const char *_rFileName)
: m_FileName(_rFileName) : m_FileName(_rFileName)
, m_Valid(false) , m_Valid(false)
{ {
if (Common::CPlugin::Load(_rFileName)) Common::CPlugin *plugin = new Common::CPlugin(_rFileName);
if (plugin->IsValid())
{ {
if (Common::CPlugin::GetInfo(m_PluginInfo)) if (plugin->GetInfo(m_PluginInfo))
m_Valid = true; m_Valid = true;
else else
PanicAlert("Could not get info about plugin %s", _rFileName); PanicAlert("Could not get info about plugin %s", _rFileName);
Common::CPlugin::Release(); delete plugin;
} }
/* /*
The DLL loading code provides enough error messages already. Possibly make some return codes The DLL loading code provides enough error messages already. Possibly make some return codes

View file

@ -19,6 +19,12 @@
#define __PLUGIN_MANAGER_H_ #define __PLUGIN_MANAGER_H_
#include "Plugin.h" #include "Plugin.h"
#include "PluginDSP.h"
#include "PluginPAD.h"
#include "PluginVideo.h"
#include "PluginWiimote.h"
#include "EventHandler.h"
#include "CoreParameter.h"
class CPluginInfo class CPluginInfo
{ {
@ -40,19 +46,33 @@ class CPluginManager
{ {
public: public:
static CPluginManager& GetInstance() {return(m_Instance);} static CPluginManager& GetInstance() {return(m_Instance);}
Common::PluginPAD *GetPAD(int controller);
Common::PluginWiimote *GetWiimote(int controller);
Common::PluginDSP *GetDSP();
Common::PluginVideo *GetVideo();
bool InitPlugins(SCoreStartupParameter scsp);
void ShutdownPlugins();
void ScanForPlugins(); void ScanForPlugins();
void OpenConfig(void* _Parent, const char *_rFilename); void OpenConfig(void* _Parent, const char *_rFilename);
void OpenDebug(void* _Parent, const char *_rFilename, bool Type, bool Show); void OpenDebug(void* _Parent, const char *_rFilename, PLUGIN_TYPE Type, bool Show);
const CPluginInfos& GetPluginInfos() {return(m_PluginInfos);} const CPluginInfos& GetPluginInfos() {return(m_PluginInfos);}
PLUGIN_GLOBALS* GetGlobals();
private: private:
static CPluginManager m_Instance; static CPluginManager m_Instance;
bool m_Initialized; bool m_Initialized;
CPluginInfos m_PluginInfos; CPluginInfos m_PluginInfos;
PLUGIN_GLOBALS* m_PluginGlobals;
Common::PluginPAD *m_pad[4];
Common::PluginVideo *m_video;
Common::PluginWiimote *m_wiimote[4];
Common::PluginDSP *m_dsp;
CPluginManager(); CPluginManager();
~CPluginManager(); ~CPluginManager();
void *LoadPlugin(const char *_rFilename);
}; };

View file

@ -1,132 +0,0 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include "Common.h"
#include "DynamicLibrary.h"
#include "Plugin_DSP.h"
namespace PluginDSP
{
// Function Pointer
TGetDllInfo GetDllInfo = 0;
TSetDllGlobals SetDllGlobals = 0;
TDllConfig DllConfig = 0;
TDllDebugger DllDebugger = 0;
TDSP_Initialize DSP_Initialize = 0;
TDSP_Shutdown DSP_Shutdown = 0;
TDSP_ReadMailBox DSP_ReadMailboxHigh = 0;
TDSP_ReadMailBox DSP_ReadMailboxLow = 0;
TDSP_WriteMailBox DSP_WriteMailboxHigh = 0;
TDSP_WriteMailBox DSP_WriteMailboxLow = 0;
TDSP_ReadControlRegister DSP_ReadControlRegister = 0;
TDSP_WriteControlRegister DSP_WriteControlRegister = 0;
TDSP_Update DSP_Update = 0;
TDSP_SendAIBuffer DSP_SendAIBuffer = 0;
TDSP_DoState DSP_DoState = 0;
//! Library Instance
DynamicLibrary plugin;
bool IsLoaded()
{
return plugin.IsLoaded();
}
void Debug(HWND _hwnd, bool Show)
{
DllDebugger(_hwnd, Show);
}
void UnloadPlugin()
{
plugin.Unload();
// Set Functions to NULL
GetDllInfo = 0;
SetDllGlobals = 0;
DllConfig = 0;
DllDebugger = 0;
DSP_Initialize = 0;
DSP_Shutdown = 0;
DSP_ReadMailboxHigh = 0;
DSP_ReadMailboxLow = 0;
DSP_WriteMailboxHigh = 0;
DSP_WriteMailboxLow = 0;
DSP_ReadControlRegister = 0;
DSP_WriteControlRegister = 0;
DSP_Update = 0;
DSP_SendAIBuffer = 0;
DSP_DoState = 0;
}
bool LoadPlugin(const char *_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"));
SetDllGlobals = reinterpret_cast<TSetDllGlobals> (plugin.Get("SetDllGlobals"));
DllConfig = reinterpret_cast<TDllConfig> (plugin.Get("DllConfig"));
DllDebugger = reinterpret_cast<TDllDebugger> (plugin.Get("DllDebugger"));
DSP_Initialize = reinterpret_cast<TDSP_Initialize> (plugin.Get("DSP_Initialize"));
DSP_Shutdown = reinterpret_cast<TDSP_Shutdown> (plugin.Get("DSP_Shutdown"));
DSP_ReadMailboxHigh = reinterpret_cast<TDSP_ReadMailBox> (plugin.Get("DSP_ReadMailboxHigh"));
DSP_ReadMailboxLow = reinterpret_cast<TDSP_ReadMailBox> (plugin.Get("DSP_ReadMailboxLow"));
DSP_WriteMailboxHigh = reinterpret_cast<TDSP_WriteMailBox> (plugin.Get("DSP_WriteMailboxHigh"));
DSP_WriteMailboxLow = reinterpret_cast<TDSP_WriteMailBox> (plugin.Get("DSP_WriteMailboxLow"));
DSP_ReadControlRegister = reinterpret_cast<TDSP_ReadControlRegister> (plugin.Get("DSP_ReadControlRegister"));
DSP_WriteControlRegister = reinterpret_cast<TDSP_WriteControlRegister> (plugin.Get("DSP_WriteControlRegister"));
DSP_Update = reinterpret_cast<TDSP_Update> (plugin.Get("DSP_Update"));
DSP_SendAIBuffer = reinterpret_cast<TDSP_SendAIBuffer> (plugin.Get("DSP_SendAIBuffer"));
DSP_DoState = reinterpret_cast<TDSP_DoState> (plugin.Get("DSP_DoState"));
if ((GetDllInfo != 0) &&
(DSP_Initialize != 0) &&
(DSP_Shutdown != 0) &&
(DSP_ReadMailboxHigh != 0) &&
(DSP_ReadMailboxLow != 0) &&
(DSP_WriteMailboxHigh != 0) &&
(DSP_WriteMailboxLow != 0) &&
(DSP_ReadControlRegister != 0) &&
(DSP_WriteControlRegister != 0) &&
(DSP_Update != 0) &&
(DSP_SendAIBuffer != 0) &&
(DSP_DoState != 0))
{
//PanicAlert("return true: %i", ret);
return true;
}
else
{
UnloadPlugin();
return false;
}
}
else if (ret == 2)
{
//PanicAlert("return true: %i", ret);
return true;
}
else if (ret == 0)
return false;
return false;
}
} // namespace

View file

@ -1,63 +0,0 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _PLUGIN_DSP_H
#define _PLUGIN_DSP_H
#include "pluginspecs_dsp.h"
namespace PluginDSP
{
bool IsLoaded();
bool LoadPlugin(const char *_Filename);
void UnloadPlugin();
// Function Types
typedef void (__cdecl* TGetDllInfo)(PLUGIN_INFO*);
typedef void (__cdecl* TSetDllGlobals)(PLUGIN_GLOBALS*);
typedef void (__cdecl* TDllConfig)(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);
typedef unsigned short (__cdecl* TDSP_ReadMailBox)(bool _CPUMailbox);
typedef unsigned short (__cdecl* TDSP_ReadControlRegister)();
typedef unsigned short (__cdecl* TDSP_WriteControlRegister)(unsigned short);
typedef void (__cdecl* TDSP_Update)(int cycles);
typedef void (__cdecl* TDSP_SendAIBuffer)(unsigned int address, int sample_rate);
typedef void (__cdecl* TDSP_DoState)(unsigned char **ptr, int mode);
// Function Pointers
extern TGetDllInfo GetDllInfo;
extern TSetDllGlobals SetDllGlobals;
extern TDllConfig DllConfig;
extern TDllDebugger DllDebugger;
extern TDSP_Initialize DSP_Initialize;
extern TDSP_Shutdown DSP_Shutdown;
extern TDSP_ReadMailBox DSP_ReadMailboxHigh;
extern TDSP_ReadMailBox DSP_ReadMailboxLow;
extern TDSP_WriteMailBox DSP_WriteMailboxHigh;
extern TDSP_WriteMailBox DSP_WriteMailboxLow;
extern TDSP_ReadControlRegister DSP_ReadControlRegister;
extern TDSP_WriteControlRegister DSP_WriteControlRegister;
extern TDSP_Update DSP_Update;
extern TDSP_SendAIBuffer DSP_SendAIBuffer;
extern TDSP_DoState DSP_DoState;
} // end of namespace PluginDSP
#endif

View file

@ -1,90 +0,0 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include "DynamicLibrary.h"
#include "Plugin_PAD.h"
namespace PluginPAD
{
// Function Pointers
TGetDllInfo GetDllInfo = 0;
TSetDllGlobals SetDllGlobals = 0;
TPAD_Shutdown PAD_Shutdown = 0;
TDllConfig DllConfig = 0;
TPAD_Initialize PAD_Initialize = 0;
TPAD_GetStatus PAD_GetStatus = 0;
TPAD_Input PAD_Input = 0;
TPAD_Rumble PAD_Rumble = 0;
TPAD_GetAttachedPads PAD_GetAttachedPads = 0;
// Library Instance
DynamicLibrary plugin;
bool IsLoaded()
{
return plugin.IsLoaded();
}
void UnloadPlugin()
{
plugin.Unload();
// Set Functions to 0
GetDllInfo = 0;
SetDllGlobals = 0;
PAD_Shutdown = 0;
DllConfig = 0;
PAD_Initialize = 0;
PAD_GetStatus = 0;
PAD_Input = 0;
PAD_Rumble = 0;
}
bool LoadPlugin(const char *_Filename)
{
if (plugin.Load(_Filename))
{
GetDllInfo = reinterpret_cast<TGetDllInfo> (plugin.Get("GetDllInfo"));
SetDllGlobals = reinterpret_cast<TSetDllGlobals> (plugin.Get("SetDllGlobals"));
DllConfig = reinterpret_cast<TDllConfig> (plugin.Get("DllConfig"));
PAD_Initialize = reinterpret_cast<TPAD_Initialize> (plugin.Get("PAD_Initialize"));
PAD_Shutdown = reinterpret_cast<TPAD_Shutdown> (plugin.Get("PAD_Shutdown"));
PAD_GetStatus = reinterpret_cast<TPAD_GetStatus> (plugin.Get("PAD_GetStatus"));
PAD_Input = reinterpret_cast<TPAD_Input> (plugin.Get("PAD_Input"));
PAD_Rumble = reinterpret_cast<TPAD_Rumble> (plugin.Get("PAD_Rumble"));
PAD_GetAttachedPads = reinterpret_cast<TPAD_GetAttachedPads>(plugin.Get("PAD_GetAttachedPads"));
if ((GetDllInfo != 0) &&
(DllConfig != 0) &&
(PAD_Initialize != 0) &&
(PAD_Shutdown != 0) &&
(PAD_GetStatus != 0) &&
(PAD_Input != 0))
{
return true;
}
else
{
UnloadPlugin();
return false;
}
}
return false;
}
} // end of namespace PluginPAD

View file

@ -1,54 +0,0 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _PLUGIN_DVD
#define _PLUGIN_DVD
#include <string.h>
#include "pluginspecs_pad.h"
namespace PluginPAD
{
bool IsLoaded();
bool LoadPlugin(const char * _Filename);
void UnloadPlugin();
// Function Types
typedef void (__cdecl* TGetDllInfo)(PLUGIN_INFO*);
typedef void (__cdecl* TSetDllGlobals)(PLUGIN_GLOBALS*);
typedef void (__cdecl* TDllConfig)(HWND);
typedef void (__cdecl* TPAD_Initialize)(SPADInitialize);
typedef void (__cdecl* TPAD_Shutdown)();
typedef void (__cdecl* TPAD_GetStatus)(u8, SPADStatus*);
typedef void (__cdecl* TPAD_Input)(u8, u8);
typedef void (__cdecl* TPAD_Rumble)(u8, unsigned int, unsigned int);
typedef unsigned int (__cdecl* TPAD_GetAttachedPads)();
// Function Pointers
extern TGetDllInfo GetDllInfo;
extern TSetDllGlobals SetDllGlobals;
extern TPAD_Shutdown PAD_Shutdown;
extern TDllConfig DllConfig;
extern TPAD_Initialize PAD_Initialize;
extern TPAD_GetStatus PAD_GetStatus;
extern TPAD_Input PAD_Input;
extern TPAD_Rumble PAD_Rumble;
extern TPAD_GetAttachedPads PAD_GetAttachedPads;
} // end of namespace PluginPAD
#endif

View file

@ -1,146 +0,0 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include "Common.h"
#include "DynamicLibrary.h"
#include "Plugin_Video.h"
#include "Plugin.h"
extern DynamicLibrary Common::CPlugin;
namespace PluginVideo
{
// Function Pointer
TGetDllInfo GetDllInfo = 0;
TSetDllGlobals SetDllGlobals = 0;
TDllConfig DllConfig = 0;
TDllDebugger DllDebugger = 0;
TVideo_Initialize Video_Initialize = 0;
TVideo_Prepare Video_Prepare = 0;
TVideo_Shutdown Video_Shutdown = 0;
TVideo_SendFifoData Video_SendFifoData = 0;
TVideo_UpdateXFB Video_UpdateXFB = 0;
TVideo_Screenshot Video_Screenshot = 0;
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();
}
void UnloadPlugin()
{
//PanicAlert("Video UnloadPlugin");
// set Functions to 0
GetDllInfo = 0;
SetDllGlobals = 0;
DllConfig = 0;
DllDebugger = 0;
Video_Initialize = 0;
Video_Prepare = 0;
Video_Shutdown = 0;
Video_SendFifoData = 0;
Video_UpdateXFB = 0;
Video_AddMessage = 0;
Video_DoState = 0;
Video_Stop = 0;
plugin.Unload();
}
// ==============================================
/* Load the plugin, but first check if we have already loaded the plugin for
the sake of showing the debugger.
ret values:
0 = failed
1 = loaded successfully
2 = already loaded from PluginManager.cpp, use it as it is */
// ------------
bool LoadPlugin(const char *_Filename)
{
int ret = plugin.Load(_Filename);
if (ret == 1)
{
GetDllInfo = reinterpret_cast<TGetDllInfo> (plugin.Get("GetDllInfo"));
SetDllGlobals = reinterpret_cast<TSetDllGlobals> (plugin.Get("SetDllGlobals"));
DllConfig = reinterpret_cast<TDllConfig> (plugin.Get("DllConfig"));
DllDebugger = reinterpret_cast<TDllDebugger> (plugin.Get("DllDebugger"));
Video_Initialize = reinterpret_cast<TVideo_Initialize> (plugin.Get("Video_Initialize"));
Video_Prepare = reinterpret_cast<TVideo_Prepare> (plugin.Get("Video_Prepare"));
Video_Shutdown = reinterpret_cast<TVideo_Shutdown> (plugin.Get("Video_Shutdown"));
Video_SendFifoData = reinterpret_cast<TVideo_SendFifoData> (plugin.Get("Video_SendFifoData"));
Video_UpdateXFB = reinterpret_cast<TVideo_UpdateXFB> (plugin.Get("Video_UpdateXFB"));
Video_Screenshot = reinterpret_cast<TVideo_Screenshot> (plugin.Get("Video_Screenshot"));
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"));
if ((GetDllInfo != 0) &&
(DllConfig != 0) &&
(DllDebugger != 0) &&
(Video_Initialize != 0) &&
(Video_Prepare != 0) &&
(Video_Shutdown != 0) &&
(Video_SendFifoData != 0) &&
(Video_UpdateXFB != 0) &&
(Video_EnterLoop != 0) &&
(Video_Screenshot != 0) &&
(Video_AddMessage != 0) &&
(Video_DoState != 0) &&
(Video_Stop != 0))
{
//PanicAlert("return true: %i", ret);
return true;
}
else
{
UnloadPlugin();
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;
}
// ============
} // namespace

View file

@ -1,67 +0,0 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _PLUGIN_VIDEO_H
#define _PLUGIN_VIDEO_H
#include "Common.h"
#include "pluginspecs_video.h"
#include "ChunkFile.h"
namespace PluginVideo
{
bool IsLoaded();
bool LoadPlugin(const char *_Filename);
void UnloadPlugin();
// Function Types
typedef void (__cdecl* TGetDllInfo)(PLUGIN_INFO*);
typedef void (__cdecl* TSetDllGlobals)(PLUGIN_GLOBALS*);
typedef void (__cdecl* TDllConfig)(HWND);
typedef void (__cdecl* TDllDebugger)(HWND, bool);
typedef void (__cdecl* TVideo_Initialize)(SVideoInitialize*);
typedef void (__cdecl* TVideo_Prepare)();
typedef void (__cdecl* TVideo_Shutdown)();
typedef void (__cdecl* TVideo_SendFifoData)(u8*,u32);
typedef void (__cdecl* TVideo_UpdateXFB)(u8*, u32, u32, s32);
typedef bool (__cdecl* TVideo_Screenshot)(const char* filename);
typedef void (__cdecl* TVideo_EnterLoop)();
typedef void (__cdecl* TVideo_AddMessage)(const char* pstr, unsigned int milliseconds);
typedef void (__cdecl* TVideo_DoState)(unsigned char **ptr, int mode);
typedef void (__cdecl* TVideo_Stop)();
// Function Pointers
extern TGetDllInfo GetDllInfo;
extern TSetDllGlobals SetDllGlobals;
extern TDllConfig DllConfig;
extern TDllDebugger DllDebugger;
extern TVideo_Initialize Video_Initialize;
extern TVideo_Prepare Video_Prepare;
extern TVideo_Shutdown Video_Shutdown;
extern TVideo_SendFifoData Video_SendFifoData;
extern TVideo_UpdateXFB Video_UpdateXFB;
extern TVideo_Screenshot Video_Screenshot;
extern TVideo_EnterLoop Video_EnterLoop;
extern TVideo_AddMessage Video_AddMessage;
extern TVideo_DoState Video_DoState;
extern TVideo_Stop Video_Stop;
} // end of namespace PluginVideo
#endif

View file

@ -1,99 +0,0 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include "Common.h"
#include "DynamicLibrary.h"
#include "Plugin_Wiimote.h"
namespace PluginWiimote
{
// Function Pointer
TGetDllInfo GetDllInfo = 0;
TSetDllGlobals SetDllGlobals = 0;
TDllConfig DllConfig = 0;
TWiimote_Initialize Wiimote_Initialize = 0;
TWiimote_Shutdown Wiimote_Shutdown = 0;
TWiimote_Output Wiimote_ControlChannel = 0;
TWiimote_Input Wiimote_InterruptChannel = 0;
TWiimote_Update Wiimote_Update = 0;
TWiimote_GetAttachedControllers Wiimote_GetAttachedControllers = 0;
TWiimote_DoState Wiimote_DoState = 0;
//! Library Instance
DynamicLibrary plugin;
bool IsLoaded()
{
return plugin.IsLoaded();
}
void UnloadPlugin()
{
plugin.Unload();
// Set Functions to NULL
GetDllInfo = 0;
SetDllGlobals = 0;
DllConfig = 0;
Wiimote_Initialize = 0;
Wiimote_Shutdown = 0;
Wiimote_ControlChannel = 0;
Wiimote_InterruptChannel = 0;
Wiimote_Update = 0;
Wiimote_GetAttachedControllers = 0;
Wiimote_DoState = 0;
}
bool LoadPlugin(const char *_Filename)
{
if (plugin.Load(_Filename))
{
GetDllInfo = reinterpret_cast<TGetDllInfo> (plugin.Get("GetDllInfo"));
SetDllGlobals = reinterpret_cast<TSetDllGlobals> (plugin.Get("SetDllGlobals"));
DllConfig = reinterpret_cast<TDllConfig> (plugin.Get("DllConfig"));
Wiimote_Initialize = reinterpret_cast<TWiimote_Initialize> (plugin.Get("Wiimote_Initialize"));
Wiimote_Shutdown = reinterpret_cast<TWiimote_Shutdown> (plugin.Get("Wiimote_Shutdown"));
Wiimote_ControlChannel = reinterpret_cast<TWiimote_Output> (plugin.Get("Wiimote_ControlChannel"));
Wiimote_InterruptChannel = reinterpret_cast<TWiimote_Input> (plugin.Get("Wiimote_InterruptChannel"));
Wiimote_Update = reinterpret_cast<TWiimote_Update> (plugin.Get("Wiimote_Update"));
Wiimote_GetAttachedControllers = reinterpret_cast<TWiimote_GetAttachedControllers> (plugin.Get("Wiimote_GetAttachedControllers"));
Wiimote_DoState = reinterpret_cast<TWiimote_DoState> (plugin.Get("Wiimote_DoState"));
if ((GetDllInfo != 0) &&
(Wiimote_Initialize != 0) &&
(Wiimote_Shutdown != 0) &&
(Wiimote_ControlChannel != 0) &&
(Wiimote_InterruptChannel != 0) &&
(Wiimote_Update != 0) &&
(Wiimote_GetAttachedControllers != 0) &&
(Wiimote_DoState != 0))
{
return true;
}
else
{
UnloadPlugin();
return false;
}
}
return false;
}
} // namespace

View file

@ -1,55 +0,0 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _PLUGIN_WIIMOTE_H
#define _PLUGIN_WIIMOTE_H
#include "pluginspecs_wiimote.h"
namespace PluginWiimote
{
bool IsLoaded();
bool LoadPlugin(const char *_Filename);
void UnloadPlugin();
// Function Types
typedef void (__cdecl* TGetDllInfo)(PLUGIN_INFO*);
typedef void (__cdecl* TSetDllGlobals)(PLUGIN_GLOBALS*);
typedef void (__cdecl* TDllConfig)(HWND);
typedef bool (__cdecl* TWiimote_Initialize)(SWiimoteInitialize);
typedef void (__cdecl* TWiimote_Shutdown)();
typedef void (__cdecl* TWiimote_Update)();
typedef void (__cdecl* TWiimote_Output)(u16 _channelID, const void* _pData, u32 _Size);
typedef void (__cdecl* TWiimote_Input)(u16 _channelID, const void* _pData, u32 _Size);
typedef unsigned int (__cdecl* TWiimote_GetAttachedControllers)();
typedef void (__cdecl* TWiimote_DoState)(void *ptr, int mode);
// Function Pointers
extern TGetDllInfo GetDllInfo;
extern TSetDllGlobals SetDllGlobals;
extern TDllConfig DllConfig;
extern TWiimote_Initialize Wiimote_Initialize;
extern TWiimote_Shutdown Wiimote_Shutdown;
extern TWiimote_Output Wiimote_ControlChannel;
extern TWiimote_Input Wiimote_InterruptChannel;
extern TWiimote_Update Wiimote_Update;
extern TWiimote_GetAttachedControllers Wiimote_GetAttachedControllers;
extern TWiimote_DoState Wiimote_DoState;
} // end of namespace PluginWiimote
#endif //_PLUGIN_WIIMOTE_H

View file

@ -64,10 +64,10 @@ files = ["Console.cpp",
"IPC_HLE/WII_IPC_HLE_WiiMote.cpp", "IPC_HLE/WII_IPC_HLE_WiiMote.cpp",
"IPC_HLE/WII_IPC_HLE_Device_usb.cpp", "IPC_HLE/WII_IPC_HLE_Device_usb.cpp",
"IPC_HLE/WiiMote_HID_Attr.cpp", "IPC_HLE/WiiMote_HID_Attr.cpp",
"Plugins/Plugin_DSP.cpp", # "Plugins/Plugin_DSP.cpp",
"Plugins/Plugin_PAD.cpp", # "Plugins/Plugin_PAD.cpp",
"Plugins/Plugin_Video.cpp", # "Plugins/Plugin_Video.cpp",
"Plugins/Plugin_Wiimote.cpp", # "Plugins/Plugin_Wiimote.cpp",
"PowerPC/PowerPC.cpp", "PowerPC/PowerPC.cpp",
"PowerPC/PPCAnalyst.cpp", "PowerPC/PPCAnalyst.cpp",
"PowerPC/PPCTables.cpp", "PowerPC/PPCTables.cpp",

View file

@ -25,8 +25,7 @@
#include "PowerPC/PowerPC.h" #include "PowerPC/PowerPC.h"
#include "PowerPC/Jit64/Jit.h" #include "PowerPC/Jit64/Jit.h"
#include "Plugins/Plugin_Video.h" #include "PluginManager.h"
#include "Plugins/Plugin_DSP.h"
#include <string> #include <string>
@ -70,8 +69,9 @@ void DoState(PointerWrap &p)
return; return;
} }
// Begin with video plugin, so that it gets a chance to clear it's caches and writeback modified things to RAM // Begin with video plugin, so that it gets a chance to clear it's caches and writeback modified things to RAM
PluginVideo::Video_DoState(p.GetPPtr(), p.GetMode()); CPluginManager &pm = CPluginManager::GetInstance();
PluginDSP::DSP_DoState(p.GetPPtr(), p.GetMode()); pm.GetVideo()->DoState(p.GetPPtr(), p.GetMode());
pm.GetDSP()->DoState(p.GetPPtr(), p.GetMode());
PowerPC::DoState(p); PowerPC::DoState(p);
HW::DoState(p); HW::DoState(p);
CoreTiming::DoState(p); CoreTiming::DoState(p);

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="DebuggerWX" Name="DebuggerWX"
ProjectGUID="{4D3CD4C5-412B-4B49-9B1B-A68A2A129C77}" ProjectGUID="{4D3CD4C5-412B-4B49-9B1B-A68A2A129C77}"
RootNamespace="DebuggerWX" RootNamespace="DebuggerWX"
@ -46,7 +46,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
WholeProgramOptimization="false" WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;..\Common\Src;..\..\..\Externals\Bochs_disasm" AdditionalIncludeDirectories="..\Common\Src;..\Core\Src;..\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;__WXMSW__;_SECURE_SCL=0" PreprocessorDefinitions="WIN32;_DEBUG;_LIB;__WXMSW__;_SECURE_SCL=0"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
@ -113,7 +113,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
WholeProgramOptimization="false" WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;..\Common\Src;..\..\..\Externals\Bochs_disasm" AdditionalIncludeDirectories="..\Common\Src;..\Core\Src;..\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;__WXMSW__;_SECURE_SCL=0" PreprocessorDefinitions="WIN32;_DEBUG;_LIB;__WXMSW__;_SECURE_SCL=0"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
@ -178,7 +178,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
WholeProgramOptimization="false" WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;..\Common\Src;..\..\..\Externals\Bochs_disasm" AdditionalIncludeDirectories="..\Common\Src;..\Core\Src;..\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;__WXMSW__;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;__WXMSW__;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="0" RuntimeLibrary="0"
BufferSecurityCheck="false" BufferSecurityCheck="false"
@ -244,7 +244,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
WholeProgramOptimization="false" WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;..\Common\Src;..\..\..\Externals\Bochs_disasm" AdditionalIncludeDirectories="..\Common\Src;..\Core\Src;..\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;__WXMSW__;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;__WXMSW__;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="0" RuntimeLibrary="0"
BufferSecurityCheck="false" BufferSecurityCheck="false"
@ -309,7 +309,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
WholeProgramOptimization="false" WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;..\Common\Src;..\..\..\Externals\Bochs_disasm" AdditionalIncludeDirectories="..\Common\Src;..\Core\Src;..\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;DEBUGFAST" PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;DEBUGFAST"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="0" BasicRuntimeChecks="0"
@ -378,7 +378,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
WholeProgramOptimization="false" WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;..\Common\Src;..\..\..\Externals\Bochs_disasm" AdditionalIncludeDirectories="..\Common\Src;..\Core\Src;..\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;DEBUGFAST" PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;DEBUGFAST"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"

View file

@ -63,8 +63,6 @@
#include "PowerPC/Jit64/Jit.h" #include "PowerPC/Jit64/Jit.h"
#include "PowerPC/Jit64/JitCache.h" // for ClearCache() #include "PowerPC/Jit64/JitCache.h" // for ClearCache()
#include "Plugins/Plugin_DSP.h" // new stuff, to let us open the DLLDebugger
#include "Plugins/Plugin_Video.h" // new stuff, to let us open the DLLDebugger
#include "PluginManager.h" #include "PluginManager.h"
#include "../../DolphinWX/Src/Config.h" #include "../../DolphinWX/Src/Config.h"
@ -419,7 +417,7 @@ void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStart
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 PLUGIN_TYPE_DSP, true
); );
} // don't have any else, just ignore it } // don't have any else, just ignore it
@ -429,7 +427,7 @@ void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStart
CPluginManager::GetInstance().OpenDebug( CPluginManager::GetInstance().OpenDebug(
GetHandle(), GetHandle(),
_LocalCoreStartupParameter.m_strVideoPlugin.c_str(), _LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
true, true PLUGIN_TYPE_VIDEO, true
); );
} // don't have any else, just ignore it } // don't have any else, just ignore it
} }

View file

@ -63,8 +63,6 @@
#include "PowerPC/Jit64/Jit.h" #include "PowerPC/Jit64/Jit.h"
#include "PowerPC/Jit64/JitCache.h" // for ClearCache() #include "PowerPC/Jit64/JitCache.h" // for ClearCache()
#include "Plugins/Plugin_DSP.h" // new stuff, to let us open the DLLDebugger
#include "Plugins/Plugin_Video.h" // new stuff, to let us open the DLLDebugger
#include "PluginManager.h" #include "PluginManager.h"
#include "../../DolphinWX/Src/Config.h" #include "../../DolphinWX/Src/Config.h"
@ -360,7 +358,7 @@ void CCodeWindow::OnToggleSoundWindow(wxCommandEvent& event)
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 PLUGIN_TYPE_DSP, true // DSP, show
); );
} }
else // hide else // hide
@ -369,7 +367,7 @@ void CCodeWindow::OnToggleSoundWindow(wxCommandEvent& event)
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, false // DSP, hide PLUGIN_TYPE_DSP, false // DSP, hide
); );
} }
} }
@ -397,7 +395,7 @@ may cause a crash when a game is later started. Todo: figure out why and fix it.
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 PLUGIN_TYPE_VIDEO, true // Video, show
); );
} }
else // hide else // hide
@ -406,7 +404,7 @@ may cause a crash when a game is later started. Todo: figure out why and fix it.
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, false // Video, hide PLUGIN_TYPE_VIDEO, false // Video, hide
); );
} }
} }

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="DolphinWX" Name="DolphinWX"
ProjectGUID="{A72606EF-C5C1-4954-90AD-F0F93A8D97D9}" ProjectGUID="{A72606EF-C5C1-4954-90AD-F0F93A8D97D9}"
RootNamespace="DolphinWX" RootNamespace="DolphinWX"
@ -56,7 +56,7 @@
Optimization="3" Optimization="3"
InlineFunctionExpansion="0" InlineFunctionExpansion="0"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\Common\Src;..\Core\Src;..\DiscIO\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\DebuggerWX\src" AdditionalIncludeDirectories="..\Common\Src;..\Core\Src;..\DebuggerWX\src;..\DiscIO\Src;..\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE" PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
StringPooling="false" StringPooling="false"
RuntimeLibrary="0" RuntimeLibrary="0"
@ -174,7 +174,7 @@
EnableIntrinsicFunctions="true" EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="false" OmitFramePointers="false"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\Common\Src;..\Core\Src;..\DiscIO\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\DebuggerWX\src" AdditionalIncludeDirectories="..\Common\Src;..\Core\Src;..\DebuggerWX\src;..\DiscIO\Src;..\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS"
StringPooling="true" StringPooling="true"
RuntimeLibrary="0" RuntimeLibrary="0"
@ -283,7 +283,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalOptions="/EHsc " AdditionalOptions="/EHsc "
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\Common\Src;..\Core\Src;..\DiscIO\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\DebuggerWX\src" AdditionalIncludeDirectories="..\Common\Src;..\Core\Src;..\DebuggerWX\src;..\DiscIO\Src;..\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;__WXDEBUG__;_WINDOWS;NOPCH;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;__WXDEBUG__;_WINDOWS;NOPCH;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
@ -394,7 +394,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalOptions="/EHsc " AdditionalOptions="/EHsc "
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\Common\Src;..\Core\Src;..\DiscIO\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\DebuggerWX\src" AdditionalIncludeDirectories="..\Common\Src;..\Core\Src;..\DebuggerWX\src;..\DiscIO\Src;..\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;__WXDEBUG__;_WINDOWS;NOPCH;_SECURE_SCL=0" PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;__WXDEBUG__;_WINDOWS;NOPCH;_SECURE_SCL=0"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
@ -506,7 +506,7 @@
Optimization="2" Optimization="2"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\Common\Src;..\Core\Src;..\DiscIO\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\DebuggerWX\src" AdditionalIncludeDirectories="..\Common\Src;..\Core\Src;..\DebuggerWX\src;..\DiscIO\Src;..\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE" PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true" StringPooling="true"
RuntimeLibrary="0" RuntimeLibrary="0"
@ -621,7 +621,7 @@
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
EnableIntrinsicFunctions="true" EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\LZO;..\Common\Src;..\Core\Src;..\DiscIO\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\DebuggerWX\src" AdditionalIncludeDirectories="..\Common\Src;..\Core\Src;..\DebuggerWX\src;..\DiscIO\Src;..\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="DEBUGFAST;WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="DEBUGFAST;WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS"
StringPooling="true" StringPooling="true"
RuntimeLibrary="0" RuntimeLibrary="0"

View file

@ -135,7 +135,15 @@ void CConfigMain::UpdateGUI()
{ {
if(Core::GetState() != Core::CORE_UNINITIALIZED) if(Core::GetState() != Core::CORE_UNINITIALIZED)
{ {
CorePage->Disable(); // Disable the Core stuff on GeneralPage
AllwaysHLEBIOS->Disable();
UseDynaRec->Disable();
UseDualCore->Disable();
LockThreads->Disable();
OptimizeQuantizers->Disable();
SkipIdle->Disable();
EnableCheats->Disable();
// --------
GamecubePage->Disable(); GamecubePage->Disable();
WiiPage->Disable(); WiiPage->Disable();
PathsPage->Disable(); PathsPage->Disable();

View file

@ -86,7 +86,6 @@ class CConfigMain
wxNotebook *Notebook; wxNotebook *Notebook;
wxPanel *GeneralPage; wxPanel *GeneralPage;
wxPanel *CorePage;
wxPanel *GamecubePage; wxPanel *GamecubePage;
wxPanel *WiiPage; wxPanel *WiiPage;
wxPanel *PathsPage; wxPanel *PathsPage;
@ -197,7 +196,6 @@ class CConfigMain
{ {
ID_NOTEBOOK = 1000, ID_NOTEBOOK = 1000,
ID_GENERALPAGE, ID_GENERALPAGE,
ID_COREPAGE,
ID_GAMECUBEPAGE, ID_GAMECUBEPAGE,
ID_WIIPAGE, ID_WIIPAGE,
ID_PATHSPAGE, ID_PATHSPAGE,

View file

@ -51,7 +51,6 @@ be accessed from Core::GetWindowHandle().
#include "Config.h" // Core #include "Config.h" // Core
#include "Core.h" #include "Core.h"
#include "HW/DVDInterface.h" #include "HW/DVDInterface.h"
#include "Plugins/Plugin_PAD.h"
#include "State.h" #include "State.h"
#include "VolumeHandler.h" #include "VolumeHandler.h"
@ -436,7 +435,7 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
else else
{ {
if(Core::GetState() != Core::CORE_UNINITIALIZED) if(Core::GetState() != Core::CORE_UNINITIALIZED)
PluginPAD::PAD_Input(event.GetKeyCode(), 1); // 1 = Down CPluginManager::GetInstance().GetPAD(0)->PAD_Input(event.GetKeyCode(), 1); // 1 = Down
event.Skip(); event.Skip();
} }
} }
@ -444,7 +443,7 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
void CFrame::OnKeyUp(wxKeyEvent& event) void CFrame::OnKeyUp(wxKeyEvent& event)
{ {
if(Core::GetState() != Core::CORE_UNINITIALIZED) if(Core::GetState() != Core::CORE_UNINITIALIZED)
PluginPAD::PAD_Input(event.GetKeyCode(), 0); // 0 = Up CPluginManager::GetInstance().GetPAD(0)->PAD_Input(event.GetKeyCode(), 0); // 0 = Up
event.Skip(); event.Skip();
} }

View file

@ -51,7 +51,6 @@ be accessed from Core::GetWindowHandle().
#include "Config.h" // Core #include "Config.h" // Core
#include "Core.h" #include "Core.h"
#include "HW/DVDInterface.h" #include "HW/DVDInterface.h"
#include "Plugins/Plugin_PAD.h"
#include "State.h" #include "State.h"
#include "VolumeHandler.h" #include "VolumeHandler.h"

View file

@ -43,6 +43,7 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_VideoOGL", "Plugins\Plugin_VideoOGL\Plugin_VideoOGL.vcproj", "{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_VideoOGL", "Plugins\Plugin_VideoOGL\Plugin_VideoOGL.vcproj", "{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F} {48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F}
{C7E5D50A-2916-464B-86A7-E10B3CC88ADA} = {C7E5D50A-2916-464B-86A7-E10B3CC88ADA}
{0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0} {0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0}
{71B16F46-0B00-4EDA-B253-D6D9D03A215C} = {71B16F46-0B00-4EDA-B253-D6D9D03A215C} {71B16F46-0B00-4EDA-B253-D6D9D03A215C} = {71B16F46-0B00-4EDA-B253-D6D9D03A215C}
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA} = {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA} {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA} = {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}
@ -54,6 +55,7 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DolphinWX", "Core\DolphinWX\DolphinWX.vcproj", "{A72606EF-C5C1-4954-90AD-F0F93A8D97D9}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DolphinWX", "Core\DolphinWX\DolphinWX.vcproj", "{A72606EF-C5C1-4954-90AD-F0F93A8D97D9}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F} {48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F}
{C7E5D50A-2916-464B-86A7-E10B3CC88ADA} = {C7E5D50A-2916-464B-86A7-E10B3CC88ADA}
{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160} = {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160} {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160} = {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}
{D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8} = {D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8} {D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8} = {D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8}
{0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0} {0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0}
@ -423,11 +425,17 @@ Global
{C7E5D50A-2916-464B-86A7-E10B3CC88ADA}.Release|x64.ActiveCfg = Release|x64 {C7E5D50A-2916-464B-86A7-E10B3CC88ADA}.Release|x64.ActiveCfg = Release|x64
{C7E5D50A-2916-464B-86A7-E10B3CC88ADA}.Release|x64.Build.0 = Release|x64 {C7E5D50A-2916-464B-86A7-E10B3CC88ADA}.Release|x64.Build.0 = Release|x64
{58E81545-241B-416E-8088-E62452EB25FA}.Debug|Win32.ActiveCfg = Debug|Win32 {58E81545-241B-416E-8088-E62452EB25FA}.Debug|Win32.ActiveCfg = Debug|Win32
{58E81545-241B-416E-8088-E62452EB25FA}.Debug|Win32.Build.0 = Debug|Win32
{58E81545-241B-416E-8088-E62452EB25FA}.Debug|x64.ActiveCfg = Debug|x64 {58E81545-241B-416E-8088-E62452EB25FA}.Debug|x64.ActiveCfg = Debug|x64
{58E81545-241B-416E-8088-E62452EB25FA}.Debug|x64.Build.0 = Debug|x64
{58E81545-241B-416E-8088-E62452EB25FA}.DebugFast|Win32.ActiveCfg = DebugFast|Win32 {58E81545-241B-416E-8088-E62452EB25FA}.DebugFast|Win32.ActiveCfg = DebugFast|Win32
{58E81545-241B-416E-8088-E62452EB25FA}.DebugFast|Win32.Build.0 = DebugFast|Win32
{58E81545-241B-416E-8088-E62452EB25FA}.DebugFast|x64.ActiveCfg = DebugFast|x64 {58E81545-241B-416E-8088-E62452EB25FA}.DebugFast|x64.ActiveCfg = DebugFast|x64
{58E81545-241B-416E-8088-E62452EB25FA}.DebugFast|x64.Build.0 = DebugFast|x64
{58E81545-241B-416E-8088-E62452EB25FA}.Release|Win32.ActiveCfg = Release|Win32 {58E81545-241B-416E-8088-E62452EB25FA}.Release|Win32.ActiveCfg = Release|Win32
{58E81545-241B-416E-8088-E62452EB25FA}.Release|Win32.Build.0 = Release|Win32
{58E81545-241B-416E-8088-E62452EB25FA}.Release|x64.ActiveCfg = Release|x64 {58E81545-241B-416E-8088-E62452EB25FA}.Release|x64.ActiveCfg = Release|x64
{58E81545-241B-416E-8088-E62452EB25FA}.Release|x64.Build.0 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View file

@ -41,13 +41,15 @@ extern "C" {
#endif #endif
// plugin types // plugin types
#define PLUGIN_TYPE_VIDEO 1 enum PLUGIN_TYPE {
#define PLUGIN_TYPE_DVD 2 PLUGIN_TYPE_VIDEO = 1,
#define PLUGIN_TYPE_PAD 3 PLUGIN_TYPE_DVD,
#define PLUGIN_TYPE_AUDIO 4 PLUGIN_TYPE_PAD,
#define PLUGIN_TYPE_COMPILER 5 PLUGIN_TYPE_AUDIO,
#define PLUGIN_TYPE_DSP 6 PLUGIN_TYPE_COMPILER,
#define PLUGIN_TYPE_WIIMOTE 7 PLUGIN_TYPE_DSP,
PLUGIN_TYPE_WIIMOTE,
};
#define STATE_MODE_READ 1 #define STATE_MODE_READ 1
#define STATE_MODE_WRITE 2 #define STATE_MODE_WRITE 2
@ -56,7 +58,7 @@ extern "C" {
typedef struct typedef struct
{ {
u16 Version; // Set to 0x0100 u16 Version; // Set to 0x0100
u16 Type; // Set to PLUGIN_TYPE_DVD PLUGIN_TYPE Type; // Set to PLUGIN_TYPE_DVD
char Name[100]; // Name of the DLL char Name[100]; // Name of the DLL
} PLUGIN_INFO; } PLUGIN_INFO;
@ -103,6 +105,31 @@ EXPORT void CALL DllDebugger(HWND _hParent, bool Show);
// output: none // output: none
// //
EXPORT void CALL SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals); EXPORT void CALL SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals);
// __________________________________________________________________________________________________
// Function: Initialize
// Purpose: Initialize the plugin
// input: Init
// output: none
//
EXPORT void CALL Initialize(void *init);
// __________________________________________________________________________________________________
// Function: Shutdown
// Purpose: This function is called when the emulator is shutting down
// a game allowing the dll to de-initialise.
// input: none
// output: none
//
EXPORT void CALL Shutdown(void);
// __________________________________________________________________________________________________
// Function: DoState
// Purpose: Saves/load state
// input/output: ptr
// input: mode
//
EXPORT void CALL DoState(unsigned char **ptr, int mode);
#if defined(__cplusplus) #if defined(__cplusplus)
} }
#endif #endif

View file

@ -30,22 +30,6 @@ typedef struct
TAudioGetStreaming pGetAudioStreaming; TAudioGetStreaming pGetAudioStreaming;
} DSPInitialize; } DSPInitialize;
// __________________________________________________________________________________________________
// Function: DSP_Initialize
// Purpose:
// input: DSPInitialize
// output: none
//
EXPORT void CALL DSP_Initialize(DSPInitialize _dspInitialize);
// __________________________________________________________________________________________________
// Function: DSP_Shutdown
// Purpose: This function is called when the emulator is shutting down
// a game allowing the dll to de-initialise.
// input: none
// output: none
//
EXPORT void CALL DSP_Shutdown(void);
// __________________________________________________________________________________________________ // __________________________________________________________________________________________________
// Function: DSP_ReadMailboxHigh // Function: DSP_ReadMailboxHigh
@ -110,13 +94,6 @@ EXPORT void CALL DSP_Update(int cycles);
// //
EXPORT void CALL DSP_SendAIBuffer(unsigned int address, int sample_rate); EXPORT void CALL DSP_SendAIBuffer(unsigned int address, int sample_rate);
// __________________________________________________________________________________________________
// Function: DSP_DoState
// Purpose: Saves/load state
// input/output: ptr
// input: mode
//
EXPORT void CALL DSP_DoState(unsigned char **ptr, int mode);
#include "ExportEpilog.h" #include "ExportEpilog.h"
#endif #endif

View file

@ -55,23 +55,6 @@ typedef struct
///////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////
// I N T E R F A C E /////////////////////////////////////////////////////////// // I N T E R F A C E ///////////////////////////////////////////////////////////
// __________________________________________________________________________________________________
// Function:
// Purpose:
// input: SPADInitialize
// output: none
//
EXPORT void CALL PAD_Initialize(SPADInitialize _PADInitialize);
// __________________________________________________________________________________________________
// Function: PAD_Shutdown
// Purpose: This function is called when the emulator is closing
// down allowing the DLL to de-initialise.
// input: none
// output: none
//
EXPORT void CALL PAD_Shutdown();
// __________________________________________________________________________________________________ // __________________________________________________________________________________________________
// Function: // Function:
// Purpose: // Purpose:
@ -104,13 +87,5 @@ EXPORT void CALL PAD_Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStre
// //
EXPORT unsigned int CALL PAD_GetAttachedPads(); EXPORT unsigned int CALL PAD_GetAttachedPads();
// __________________________________________________________________________________________________
// Function: PAD_DoState
// Purpose: Saves/load state
// input/output: ptr
// input: mode
//
EXPORT void CALL PAD_DoState(void *ptr, int mode);
#include "ExportEpilog.h" #include "ExportEpilog.h"
#endif #endif

View file

@ -78,14 +78,6 @@ typedef struct
// I N T E R F A C E //////////////////////////////////////////////////////////////////////////////// // I N T E R F A C E ////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////
// __________________________________________________________________________________________________
// Function: Video_Initialize
// Purpose:
// input: SVideoInitialize* - pointer because window data will be passed back
// output: none
//
EXPORT void CALL Video_Initialize(SVideoInitialize* _pvideoInitialize);
// __________________________________________________________________________________________________ // __________________________________________________________________________________________________
// Function: Video_Prepare // Function: Video_Prepare
// Purpose: This function is called from the EmuThread before the // Purpose: This function is called from the EmuThread before the
@ -96,15 +88,6 @@ EXPORT void CALL Video_Initialize(SVideoInitialize* _pvideoInitialize);
// //
EXPORT void CALL Video_Prepare(void); EXPORT void CALL Video_Prepare(void);
// __________________________________________________________________________________________________
// Function: Video_Shutdown
// Purpose: This function is called when the emulator is shutting down
// a game allowing the dll to de-initialise.
// input: none
// output: none
//
EXPORT void CALL Video_Shutdown(void);
// __________________________________________________________________________________________________ // __________________________________________________________________________________________________
// Function: Video_ExecuteFifoBuffer // Function: Video_ExecuteFifoBuffer
// Purpose: This function is called if data is inside the fifo-buffer // Purpose: This function is called if data is inside the fifo-buffer
@ -147,14 +130,6 @@ EXPORT void CALL Video_EnterLoop(void);
// //
EXPORT void CALL Video_AddMessage(const char* pstr, unsigned int milliseconds); EXPORT void CALL Video_AddMessage(const char* pstr, unsigned int milliseconds);
// __________________________________________________________________________________________________
// Function: Video_DoState
// Purpose: Saves/Loads the current video data state (depends on mode parameter)
// input/output: ptr
// input: mode
//
EXPORT void CALL Video_DoState(unsigned char **ptr, int mode);
// __________________________________________________________________________________________________ // __________________________________________________________________________________________________
// Function: Video_Stop // Function: Video_Stop
// Purpose: Stop the video plugin before shutdown // Purpose: Stop the video plugin before shutdown

View file

@ -46,23 +46,6 @@ typedef struct
// I N T E R F A C E //////////////////////////////////////////////////////////////////////////////// // I N T E R F A C E ////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////
// __________________________________________________________________________________________________
// Function:
// Purpose:
// input: WiimoteInitialize
// output: If at least one real Wiimote was found or not
//
EXPORT bool CALL Wiimote_Initialize(SWiimoteInitialize _WiimoteInitialize);
// __________________________________________________________________________________________________
// Function: Wiimote_Shutdown
// Purpose: This function is called when the emulator is closing
// down allowing the DLL to de-initialise.
// input: none
// output: none
//
EXPORT void CALL Wiimote_Shutdown();
// __________________________________________________________________________________________________ // __________________________________________________________________________________________________
// Function: Wiimote_Output // Function: Wiimote_Output
// Purpose: An L2CAP packet is passed from the Core to the Wiimote, // Purpose: An L2CAP packet is passed from the Core to the Wiimote,
@ -97,14 +80,6 @@ EXPORT void CALL Wiimote_Update();
// //
EXPORT unsigned int CALL Wiimote_GetAttachedControllers(); EXPORT unsigned int CALL Wiimote_GetAttachedControllers();
// __________________________________________________________________________________________________
// Function: Wiimote_DoState
// Purpose: Saves/load state
// input/output: ptr
// input: mode
//
EXPORT void CALL Wiimote_DoState(void *ptr, int mode);
#include "ExportEpilog.h" #include "ExportEpilog.h"
#endif //_WIIMOTE_H_INCLUDED__ #endif //_WIIMOTE_H_INCLUDED__

View file

@ -203,18 +203,18 @@ void DllConfig(HWND _hParent)
#endif #endif
} }
void DSP_Initialize(DSPInitialize _dspInitialize) void Initialize(void *init)
{ {
g_Config.LoadDefaults(); g_Config.LoadDefaults();
g_Config.Load(); g_Config.Load();
g_dspInitialize = _dspInitialize; g_dspInitialize = *(DSPInitialize*)init;
g_pMemory = g_dspInitialize.pGetMemoryPointer(0); g_pMemory = g_dspInitialize.pGetMemoryPointer(0);
#if defined(_DEBUG) || defined(DEBUGFAST) #if defined(_DEBUG) || defined(DEBUGFAST)
gpName = g_dspInitialize.pName(); // save the game name globally gpName = g_dspInitialize.pName(); // save the game name globally
for (int i = 0; i < gpName.length(); ++i) // and fix it for (u32 i = 0; i < gpName.length(); ++i) // and fix it
{ {
wprintf(L"%c", gpName[i]); wprintf(L"%c", gpName[i]);
std::cout << gpName[i]; std::cout << gpName[i];
@ -242,7 +242,7 @@ void DSP_Initialize(DSPInitialize _dspInitialize)
#endif #endif
} }
void DSP_Shutdown() void Shutdown()
{ {
if (log_ai) if (log_ai)
g_wave_writer.Stop(); g_wave_writer.Stop();
@ -266,7 +266,7 @@ void DSP_Shutdown()
#endif #endif
} }
void DSP_DoState(unsigned char **ptr, int mode) { void DoState(unsigned char **ptr, int mode) {
PointerWrap p(ptr, mode); PointerWrap p(ptr, mode);
} }

View file

@ -121,7 +121,7 @@ void DllConfig(HWND _hParent)
{} {}
void DSP_DoState(unsigned char **ptr, int mode) { void DoState(unsigned char **ptr, int mode) {
PointerWrap p(ptr, mode); PointerWrap p(ptr, mode);
} }
@ -217,11 +217,10 @@ void dspi_req_dsp_irq()
g_dspInitialize.pGenerateDSPInterrupt(); g_dspInitialize.pGenerateDSPInterrupt();
} }
void Initialize(void *init)
void DSP_Initialize(DSPInitialize _dspInitialize)
{ {
bCanWork = true; bCanWork = true;
g_dspInitialize = _dspInitialize; g_dspInitialize = *(DSPInitialize*)init;
gdsp_init(); gdsp_init();
g_dsp.step_counter = 0; g_dsp.step_counter = 0;
@ -289,7 +288,7 @@ void DSP_Initialize(DSPInitialize _dspInitialize)
} }
void DSP_Shutdown(void) void Shutdown(void)
{ {
if (log_ai) if (log_ai)
g_wave_writer.Stop(); g_wave_writer.Stop();

View file

@ -101,22 +101,22 @@ void DllConfig(HWND _hParent)
{ {
} }
void DSP_Initialize(DSPInitialize _dspInitialize) void Initialize(void *init)
{ {
g_dspInitialize = _dspInitialize; g_dspInitialize = *(DSPInitialize*)init;
g_pMemory = g_dspInitialize.pGetMemoryPointer(0); g_pMemory = g_dspInitialize.pGetMemoryPointer(0);
CDSPHandler::CreateInstance(); CDSPHandler::CreateInstance();
} }
void DSP_Shutdown() void Shutdown()
{ {
CDSPHandler::Destroy(); CDSPHandler::Destroy();
} }
void DSP_DoState(unsigned char **ptr, int mode) { void DoState(unsigned char **ptr, int mode) {
PointerWrap p(ptr, mode); PointerWrap p(ptr, mode);
} }

View file

@ -189,13 +189,13 @@ void DllConfig(HWND _hParent)
void DllDebugger(HWND _hParent, bool Show) { void DllDebugger(HWND _hParent, bool Show) {
} }
void PAD_Initialize(SPADInitialize _PADInitialize) void Initialize(void *init)
{ {
#ifdef RECORD_REPLAY #ifdef RECORD_REPLAY
LoadRecord(); LoadRecord();
#endif #endif
g_PADInitialize = _PADInitialize; g_PADInitialize = *(SPADInitialize*)init;
#ifdef _WIN32 #ifdef _WIN32
dinput.Init((HWND)g_PADInitialize.hWnd); dinput.Init((HWND)g_PADInitialize.hWnd);
#elif defined(HAVE_X11) && HAVE_X11 #elif defined(HAVE_X11) && HAVE_X11
@ -206,8 +206,10 @@ void PAD_Initialize(SPADInitialize _PADInitialize)
LoadConfig(); LoadConfig();
} }
void DoState(unsigned char **ptr, int mode) {
}
void PAD_Shutdown() void Shutdown()
{ {
#ifdef RECORD_STORE #ifdef RECORD_STORE
SaveRecord(); SaveRecord();

View file

@ -10,10 +10,6 @@ if not env['HAVE_X11']:
print name + " must have X11 to be built" print name + " must have X11 to be built"
Return() Return()
if env['GLTEST']:
print name + " Doesn't work with testgl"
Return()
files = [ files = [
"PadSimple.cpp", "PadSimple.cpp",

View file

@ -53,7 +53,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="3" Optimization="3"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../../PluginSpecs;..\..\Core\InputCommon\Src;../../Core/Common/Src;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\wxWidgets\lib\vc_lib\msw;..\..\..\Externals\wxWidgets\include\msvc" AdditionalIncludeDirectories="..\..\Core\Common\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\wxWidgets\lib\vc_lib\msw;..\..\..\Externals\wxWidgets\include\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PAD_SIMPLE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PAD_SIMPLE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
StringPooling="true" StringPooling="true"
RuntimeLibrary="0" RuntimeLibrary="0"
@ -155,7 +155,7 @@
Optimization="3" Optimization="3"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
EnableIntrinsicFunctions="true" EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="../../PluginSpecs;..\..\Core\InputCommon\Src;../../Core/Common/Src;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\wxWidgets\lib\vc_lib\msw;..\..\..\Externals\wxWidgets\include\msvc" AdditionalIncludeDirectories="..\..\Core\Common\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\wxWidgets\lib\vc_lib\msw;..\..\..\Externals\wxWidgets\include\msvc"
PreprocessorDefinitions="_SECURE_SCL=0;WIN32;NDEBUG;_WINDOWS;_USRDLL;PAD_SIMPLE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;__WXMSW__;NOPCH" PreprocessorDefinitions="_SECURE_SCL=0;WIN32;NDEBUG;_WINDOWS;_USRDLL;PAD_SIMPLE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;__WXMSW__;NOPCH"
StringPooling="true" StringPooling="true"
RuntimeLibrary="0" RuntimeLibrary="0"
@ -254,7 +254,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="../../PluginSpecs;..\..\Core\InputCommon\Src;../../Core/Common/Src;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\wxWidgets\lib\vc_lib\msw;..\..\..\Externals\wxWidgets\include\msvc" AdditionalIncludeDirectories="..\..\Core\Common\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\wxWidgets\lib\vc_lib\msw;..\..\..\Externals\wxWidgets\include\msvc"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PAD_SIMPLE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PAD_SIMPLE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
@ -352,7 +352,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="../../PluginSpecs;..\..\Core\InputCommon\Src;../../Core/Common/Src;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\wxWidgets\lib\vc_lib\msw;..\..\..\Externals\wxWidgets\include\msvc" AdditionalIncludeDirectories="..\..\Core\Common\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\wxWidgets\lib\vc_lib\msw;..\..\..\Externals\wxWidgets\include\msvc"
PreprocessorDefinitions="_SECURE_SCL=0;WIN32;_DEBUG;_WINDOWS;_USRDLL;PAD_SIMPLE_EXPORTS;_CRT_SECURE_NO_DEPRECATE" PreprocessorDefinitions="_SECURE_SCL=0;WIN32;_DEBUG;_WINDOWS;_USRDLL;PAD_SIMPLE_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
@ -451,7 +451,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="3" Optimization="3"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../../PluginSpecs;..\..\Core\InputCommon\Src;../../Core/Common/Src;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\wxWidgets\lib\vc_lib\msw;..\..\..\Externals\wxWidgets\include\msvc" AdditionalIncludeDirectories="..\..\Core\Common\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\wxWidgets\lib\vc_lib\msw;..\..\..\Externals\wxWidgets\include\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PAD_SIMPLE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;DEBUGFAST;_SECURE_SCL=0" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PAD_SIMPLE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;DEBUGFAST;_SECURE_SCL=0"
StringPooling="true" StringPooling="true"
RuntimeLibrary="0" RuntimeLibrary="0"
@ -553,7 +553,7 @@
Optimization="3" Optimization="3"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
EnableIntrinsicFunctions="true" EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="../../PluginSpecs;..\..\Core\InputCommon\Src;../../Core/Common/Src;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\wxWidgets\lib\vc_lib\msw;..\..\..\Externals\wxWidgets\include\msvc" AdditionalIncludeDirectories="..\..\Core\Common\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\wxWidgets\lib\vc_lib\msw;..\..\..\Externals\wxWidgets\include\msvc"
PreprocessorDefinitions="_SECURE_SCL=0;WIN32;NDEBUG;_WINDOWS;_USRDLL;PAD_SIMPLE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;DEBUGFAST" PreprocessorDefinitions="_SECURE_SCL=0;WIN32;NDEBUG;_WINDOWS;_USRDLL;PAD_SIMPLE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;DEBUGFAST"
StringPooling="true" StringPooling="true"
RuntimeLibrary="0" RuntimeLibrary="0"

View file

@ -190,13 +190,12 @@ void ConfigDialog::OnClose(wxCloseEvent& event) {
void ConfigDialog::OnKeyDown(wxKeyEvent& event) { void ConfigDialog::OnKeyDown(wxKeyEvent& event) {
if(clickedButton != NULL) { if(clickedButton != NULL) {
int page = m_Notebook->GetSelection(); int page = m_Notebook->GetSelection();
static EventHandler *eventHandler = (EventHandler *)globals->eventHandler; EventHandler *eventHandler = (EventHandler *)globals->eventHandler;
fprintf(stderr, "Got key code %d\n",event.GetKeyCode()); fprintf(stderr, "Got key code %d\n",event.GetKeyCode());
sf::Key::Code sfcode = eventHandler->wxCharCodeToSF(event.GetKeyCode()); sf::Key::Code sfcode = eventHandler->wxCharCodeToSF(event.GetKeyCode());
char sfstr[100]; char sfstr[100];
eventHandler->SFKeyToString(sfcode, sfstr); eventHandler->SFKeyToString(sfcode, sfstr);
// pad[page].keyForControl[clickedButton->GetId()] = sfcode;
if (registerKey(page, clickedButton->GetId(), sfcode)) if (registerKey(page, clickedButton->GetId(), sfcode))
clickedButton->SetLabel(wxString::FromAscii(sfstr)); clickedButton->SetLabel(wxString::FromAscii(sfstr));
clickedButton->Disconnect(); clickedButton->Disconnect();

View file

@ -54,7 +54,7 @@ static const char* controlNames[] =
"Mic-button", "Mic-button",
}; };
PLUGIN_GLOBALS* globals; PLUGIN_GLOBALS* globals = NULL;
SPads pad[4]; SPads pad[4];
bool KeyStatus[NUMCONTROLS]; bool KeyStatus[NUMCONTROLS];
@ -92,7 +92,7 @@ const SPADStatus& PlayRecord()
bool registerKey(int nPad, int id, sf::Key::Code code, int mods) { bool registerKey(int nPad, int id, sf::Key::Code code, int mods) {
Keys key, oldKey; Keys key, oldKey;
static EventHandler *eventHandler = (EventHandler *)globals->eventHandler; EventHandler *eventHandler = (EventHandler *)globals->eventHandler;
key.inputType = KeyboardInput; key.inputType = KeyboardInput;
key.keyCode = code; key.keyCode = code;
@ -228,17 +228,20 @@ void DllConfig(HWND _hParent)
void DllDebugger(HWND _hParent, bool Show) { void DllDebugger(HWND _hParent, bool Show) {
} }
void PAD_Initialize(SPADInitialize _PADInitialize) void DoState(unsigned char **ptr, int mode) {
}
void Initialize(void *init)
{ {
#ifdef RECORD_REPLAY #ifdef RECORD_REPLAY
LoadRecord(); LoadRecord();
#endif #endif
g_PADInitialize = *(SPADInitialize*)init;
LoadConfig(); LoadConfig();
} }
void PAD_Shutdown() void Shutdown()
{ {
#ifdef RECORD_STORE #ifdef RECORD_STORE
SaveRecord(); SaveRecord();

View file

@ -175,11 +175,10 @@ void DllConfig(HWND _hParent)
} }
} }
void Video_Initialize(SVideoInitialize* _pVideoInitialize) void Initialize(void *init)
{ {
if (_pVideoInitialize == NULL)
return;
SVideoInitialize *_pVideoInitialize = (SVideoInitialize*)init;
frameCount = 0; frameCount = 0;
g_VideoInitialize = *_pVideoInitialize; g_VideoInitialize = *_pVideoInitialize;
Init(); Init();
@ -191,7 +190,7 @@ void Video_Initialize(SVideoInitialize* _pVideoInitialize)
} }
void Video_DoState(unsigned char **ptr, int mode) { void DoState(unsigned char **ptr, int mode) {
// Clear all caches // Clear all caches
TextureCache::Invalidate(); TextureCache::Invalidate();
@ -219,7 +218,7 @@ void Video_Prepare(void)
OpcodeDecoder_Init(); OpcodeDecoder_Init();
} }
void Video_Shutdown(void) void Shutdown(void)
{ {
Fifo_Shutdown(); Fifo_Shutdown();
OpcodeDecoder_Shutdown(); OpcodeDecoder_Shutdown();

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"
@ -165,7 +165,7 @@
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="false" OmitFramePointers="false"
WholeProgramOptimization="true" WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../PluginSpecs;../../Core/Common/Src;../../Core/VideoCommon/Src;./Src;./Src/Windows;../../../Externals;..\..\..\Externals\libjpeg;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\..\..\Externals\Glew" AdditionalIncludeDirectories="../../Core/InputCommon/Src;../../PluginSpecs;../../Core/Common/Src;../../Core/VideoCommon/Src;./Src;./Src/Windows;../../../Externals;..\..\..\Externals\libjpeg;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\..\..\Externals\Glew"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
StringPooling="true" StringPooling="true"
ExceptionHandling="1" ExceptionHandling="1"
@ -937,6 +937,10 @@
RelativePath=".\Src\GLUtil.h" RelativePath=".\Src\GLUtil.h"
> >
</File> </File>
<File
RelativePath=".\Src\GLWindow.h"
>
</File>
<File <File
RelativePath=".\Src\main.cpp" RelativePath=".\Src\main.cpp"
> >

View file

@ -685,7 +685,7 @@ void OpenGL_Update()
rcWindow.bottom = GLWin.height; rcWindow.bottom = GLWin.height;
break; break;
case ClientMessage: //TODO: We aren't reading this correctly, It could be anything, highest chance is that it's a close event though case ClientMessage: //TODO: We aren't reading this correctly, It could be anything, highest chance is that it's a close event though
Video_Shutdown(); // Calling from here since returning false does nothing Shutdown(); // Calling from here since returning false does nothing
return; return;
break; break;
default: default:

View file

@ -8,7 +8,7 @@
#include "Config.h" #include "Config.h"
#include "pluginspecs_video.h" #include "pluginspecs_video.h"
#include <GL/glew.h> #include <GLew/glew.h>
#if defined(__APPLE__) #if defined(__APPLE__)
#include <OpenGL/gl.h> #include <OpenGL/gl.h>
@ -38,6 +38,7 @@ class GLWindow {
protected: protected:
EventHandler* eventHandler;
res origRes, currFullRes, currWinRes; res origRes, currFullRes, currWinRes;
std::vector<res> fullResolutions; std::vector<res> fullResolutions;
std::vector<res> winResolutions; std::vector<res> winResolutions;
@ -74,6 +75,7 @@ public:
} }
} }
void SetEventHandler(EventHandler *eh) { eventHandler = eh;}
bool GetProperty(OGL_Props prop) {return properties[prop];} bool GetProperty(OGL_Props prop) {return properties[prop];}
virtual bool SetProperty(OGL_Props prop, bool value) virtual bool SetProperty(OGL_Props prop, bool value)
{return properties[prop] = value;} {return properties[prop] = value;}

View file

@ -1,7 +1,5 @@
#include "X11Window.h" #include "X11Window.h"
static EventHandler *eventHandler = (EventHandler *)globals->eventHandler;
X11Window::X11Window() : GLWindow() { X11Window::X11Window() : GLWindow() {
XVisualInfo *vi; XVisualInfo *vi;
@ -175,7 +173,6 @@ bool X11Window::PeekMessages() {
// Taken from sfml code // Taken from sfml code
void X11Window::ProcessEvent(XEvent WinEvent) { void X11Window::ProcessEvent(XEvent WinEvent) {
// static EventHandler *eventHandler = EventHandler::GetInstance();
switch (WinEvent.type) { switch (WinEvent.type) {
case KeyPress : case KeyPress :

View file

@ -200,11 +200,8 @@ void DllConfig(HWND _hParent)
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Initialize video // Initialize video
// ¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯
void Video_Initialize(SVideoInitialize* _pVideoInitialize) void Initialize(void *init)
{ {
// When will this happen?
if (_pVideoInitialize == NULL) return;
// -------------------------------------------------- // --------------------------------------------------
/* Dolphin currently crashes if the dll is loaded when a game is started so we close the /* Dolphin currently crashes if the dll is loaded when a game is started so we close the
debugger and open it again after loading debugger and open it again after loading
@ -219,7 +216,8 @@ void Video_Initialize(SVideoInitialize* _pVideoInitialize)
// -------------------------------------------------- // --------------------------------------------------
frameCount = 0; frameCount = 0;
g_VideoInitialize = *_pVideoInitialize; // Create a shortcut to _pVideoInitialize that can also update it SVideoInitialize *_pVideoInitialize = (SVideoInitialize*)init;
g_VideoInitialize = *(_pVideoInitialize); // Create a shortcut to _pVideoInitialize that can also update it
InitLUTs(); InitLUTs();
InitXFBConvTables(); InitXFBConvTables();
g_Config.Load(); g_Config.Load();
@ -238,7 +236,7 @@ void Video_Initialize(SVideoInitialize* _pVideoInitialize)
Renderer::AddMessage("Dolphin OpenGL Video Plugin" ,5000); Renderer::AddMessage("Dolphin OpenGL Video Plugin" ,5000);
} }
void Video_DoState(unsigned char **ptr, int mode) { void DoState(unsigned char **ptr, int mode) {
//#ifdef _WIN32 //#ifdef _WIN32
// What is this code doing here? // What is this code doing here?
// if (!wglMakeCurrent(hDC,hRC)) { // if (!wglMakeCurrent(hDC,hRC)) {
@ -293,7 +291,7 @@ void Video_Prepare(void)
TextureConverter::Init(); TextureConverter::Init();
} }
void Video_Shutdown(void) void Shutdown(void)
{ {
TextureConverter::Shutdown(); TextureConverter::Shutdown();
VertexLoaderManager::Shutdown(); VertexLoaderManager::Shutdown();

View file

@ -67,6 +67,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize,
if (! glWin) if (! glWin)
return false; return false;
glWin->SetEventHandler((EventHandler *)globals->eventHandler);
return true; return true;
} }

View file

@ -138,8 +138,9 @@ void DllConfig(HWND _hParent)
#endif #endif
} }
extern "C" bool Wiimote_Initialize(SWiimoteInitialize _WiimoteInitialize) extern "C" void Initialize(void *init)
{ {
SWiimoteInitialize _WiimoteInitialize = *(SWiimoteInitialize *)init;
// ---------------------------------------- // ----------------------------------------
// Debugging window // Debugging window
// ---------- // ----------
@ -153,11 +154,12 @@ extern "C" bool Wiimote_Initialize(SWiimoteInitialize _WiimoteInitialize)
g_WiimoteInitialize = _WiimoteInitialize; g_WiimoteInitialize = _WiimoteInitialize;
/* We will run WiiMoteReal::Initialize() even if we are not using a real wiimote, /* We will run WiiMoteReal::Initialize() even if we are not using a
we will initiate wiiuse.dll, but we will return before creating a new thread real wiimote, we will initiate wiiuse.dll, but we will return before
for it if we find no real Wiimotes. Then g_UseRealWiiMote will also be false creating a new thread for it if we find no real Wiimotes. Then
This function call will be done instantly if there is no real Wiimote connected. g_UseRealWiiMote will also be false This function call will be done
I'm not sure how long time it takes if a Wiimote is connected. */ instantly if there is no real Wiimote connected. I'm not sure how
long time it takes if a Wiimote is connected. */
#if HAVE_WIIUSE #if HAVE_WIIUSE
g_UseRealWiiMote = WiiMoteReal::Initialize() > 0; g_UseRealWiiMote = WiiMoteReal::Initialize() > 0;
#endif #endif
@ -165,11 +167,10 @@ extern "C" bool Wiimote_Initialize(SWiimoteInitialize _WiimoteInitialize)
WiiMoteEmu::Initialize(); WiiMoteEmu::Initialize();
return g_UseRealWiiMote;
} }
extern "C" void Wiimote_DoState(void* ptr, int mode) extern "C" void DoState(unsigned char **ptr, int mode)
{ {
#if HAVE_WIIUSE #if HAVE_WIIUSE
WiiMoteReal::DoState(ptr, mode); WiiMoteReal::DoState(ptr, mode);
@ -177,7 +178,7 @@ extern "C" void Wiimote_DoState(void* ptr, int mode)
WiiMoteEmu::DoState(ptr, mode); WiiMoteEmu::DoState(ptr, mode);
} }
extern "C" void Wiimote_Shutdown(void) extern "C" void Shutdown(void)
{ {
#if HAVE_WIIUSE #if HAVE_WIIUSE
WiiMoteReal::Shutdown(); WiiMoteReal::Shutdown();

View file

@ -142,7 +142,7 @@ void ConfigBox::OnKeyDown(wxKeyEvent& event)
void ConfigBox::OnClose(wxCloseEvent& /*event*/) void ConfigBox::OnClose(wxCloseEvent& /*event*/)
{ {
EndModal(0); EndModal(0);
if(!emulator_running) PAD_Shutdown(); // Close pads, unless we are running a game if(!emulator_running) Shutdown(); // Close pads, unless we are running a game
} }
// Call about dialog // Call about dialog

View file

@ -193,7 +193,7 @@ void DllConfig(HWND _hParent)
SPADInitialize _PADInitialize; SPADInitialize _PADInitialize;
_PADInitialize.hWnd = NULL; _PADInitialize.hWnd = NULL;
_PADInitialize.pLog = NULL; _PADInitialize.pLog = NULL;
PAD_Initialize(_PADInitialize); Initialize((void*)&_PADInitialize);
emulator_running = FALSE; // Set it back to false emulator_running = FALSE; // Set it back to false
} }
@ -231,8 +231,9 @@ void DllDebugger(HWND _hParent, bool Show) {
// Init PAD (start emulation) // Init PAD (start emulation)
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
void PAD_Initialize(SPADInitialize _PADInitialize) void Initialize(void *init)
{ {
SPADInitialize _PADInitialize = *(SPADInitialize*)init;
emulator_running = TRUE; emulator_running = TRUE;
#ifdef _DEBUG #ifdef _DEBUG
DEBUG_INIT(); DEBUG_INIT();
@ -332,7 +333,7 @@ int Search_Devices()
// Shutdown PAD (stop emulation) // Shutdown PAD (stop emulation)
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
void PAD_Shutdown() void Shutdown()
{ {
if (joysticks[0].enabled) if (joysticks[0].enabled)
SDL_JoystickClose(joystate[0].joy); SDL_JoystickClose(joystate[0].joy);
@ -363,6 +364,7 @@ void PAD_Shutdown()
} }
// Set buttons status from wxWidgets in the main application // Set buttons status from wxWidgets in the main application
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
void PAD_Input(u8 _Key, u8 _UpDown) void PAD_Input(u8 _Key, u8 _UpDown)
@ -378,6 +380,8 @@ void PAD_Input(u8 _Key, u8 _UpDown)
} }
} }
void DoState(unsigned char **ptr, int mode) {
}
// Set PAD status. This is called from SerialInterface_Devices.cpp // Set PAD status. This is called from SerialInterface_Devices.cpp
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯

View file

@ -202,8 +202,9 @@ void DllDebugger(HWND _hParent, bool Show) {
// Init PAD (start emulation) // Init PAD (start emulation)
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
void PAD_Initialize(SPADInitialize _PADInitialize) void Initialize(void *init)
{ {
SPADInitialize _PADInitialize = *(SPADInitialize*)init;
emulator_running = TRUE; emulator_running = TRUE;
#ifdef _DEBUG #ifdef _DEBUG
DEBUG_INIT(); DEBUG_INIT();
@ -237,7 +238,7 @@ void PAD_Initialize(SPADInitialize _PADInitialize)
// Shutdown PAD (stop emulation) // Shutdown PAD (stop emulation)
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
void PAD_Shutdown() void Shutdown()
{ {
if(joysticks[0].enabled) if(joysticks[0].enabled)
SDL_JoystickClose(joystate[0].joy); SDL_JoystickClose(joystate[0].joy);
@ -267,7 +268,8 @@ void PAD_Shutdown()
#endif #endif
} }
void DoState(unsigned char **ptr, int mode) {
}
// Set buttons status from wxWidgets in the main application // Set buttons status from wxWidgets in the main application
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯