Eliminated the plugin interface. Merged DX9/DX11/OGL video plugins into Dolphin. It could still use a lot of cleanup. Lots of things are still named "plugin". Software renderer is temporarily disabled until it gets some namespaces. I only updated vs08/10, Linux/OSX builds are broken.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6996 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Jordan Woyak
2011-01-31 01:28:32 +00:00
parent ae7c64ec13
commit fbaf965995
136 changed files with 1537 additions and 3412 deletions
+13 -49
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Version="9.00"
Name="Common"
ProjectGUID="{C573CAF7-EE6A-458E-8049-16C0BF34C2E9}"
RootNamespace="Common"
@@ -453,46 +453,6 @@
<References>
</References>
<Files>
<Filter
Name="Plugins"
>
<File
RelativePath=".\Src\Plugin.cpp"
>
</File>
<File
RelativePath=".\Src\Plugin.h"
>
</File>
<File
RelativePath=".\Src\PluginVideo.cpp"
>
</File>
<File
RelativePath=".\Src\PluginVideo.h"
>
</File>
<Filter
Name="Specs"
>
<File
RelativePath="..\..\PluginSpecs\ExportEpilog.h"
>
</File>
<File
RelativePath="..\..\PluginSpecs\ExportProlog.h"
>
</File>
<File
RelativePath="..\..\PluginSpecs\PluginSpecs.h"
>
</File>
<File
RelativePath="..\..\PluginSpecs\pluginspecs_video.h"
>
</File>
</Filter>
</Filter>
<Filter
Name="Logging"
>
@@ -641,14 +601,6 @@
RelativePath=".\Src\DebugInterface.h"
>
</File>
<File
RelativePath=".\Src\DynamicLibrary.cpp"
>
</File>
<File
RelativePath=".\Src\DynamicLibrary.h"
>
</File>
<File
RelativePath=".\Src\ExtendedTrace.cpp"
>
@@ -761,6 +713,10 @@
RelativePath=".\Src\OpenCL.h"
>
</File>
<File
RelativePath="..\..\PluginSpecs\PluginSpecs.h"
>
</File>
<File
RelativePath=".\Src\SConscript"
>
@@ -897,6 +853,14 @@
RelativePath=".\Src\Version.cpp"
>
</File>
<File
RelativePath=".\Src\VideoBackendBase.cpp"
>
</File>
<File
RelativePath=".\Src\VideoBackendBase.h"
>
</File>
<File
RelativePath=".\Src\x64Analyzer.cpp"
>
+2 -8
View File
@@ -242,7 +242,6 @@
<ClCompile Include="Src\Crypto\ec.cpp" />
<ClCompile Include="Src\Crypto\md5.cpp" />
<ClCompile Include="Src\Crypto\sha1.cpp" />
<ClCompile Include="Src\DynamicLibrary.cpp" />
<ClCompile Include="Src\ExtendedTrace.cpp" />
<ClCompile Include="Src\FileSearch.cpp" />
<ClCompile Include="Src\FileUtil.cpp" />
@@ -256,9 +255,6 @@
<ClCompile Include="Src\MsgHandler.cpp" />
<ClCompile Include="Src\NandPaths.cpp" />
<ClCompile Include="Src\OpenCL.cpp" />
<ClCompile Include="Src\Plugin.cpp" />
<ClCompile Include="Src\PluginDSP.cpp" />
<ClCompile Include="Src\PluginVideo.cpp" />
<ClCompile Include="Src\SDCardUtil.cpp" />
<ClCompile Include="Src\stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
@@ -275,6 +271,7 @@
<ClCompile Include="Src\Thunk.cpp" />
<ClCompile Include="Src\Timer.cpp" />
<ClCompile Include="Src\Version.cpp" />
<ClCompile Include="Src\VideoBackendBase.cpp" />
<ClCompile Include="Src\x64Analyzer.cpp" />
<ClCompile Include="Src\x64Emitter.cpp" />
</ItemGroup>
@@ -299,7 +296,6 @@
<ClInclude Include="Src\Crypto\sha1.h" />
<ClInclude Include="Src\Crypto\tools.h" />
<ClInclude Include="Src\DebugInterface.h" />
<ClInclude Include="Src\DynamicLibrary.h" />
<ClInclude Include="Src\ExtendedTrace.h" />
<ClInclude Include="Src\FifoQueue.h" />
<ClInclude Include="Src\FileSearch.h" />
@@ -316,9 +312,7 @@
<ClInclude Include="Src\MsgHandler.h" />
<ClInclude Include="Src\NandPaths.h" />
<ClInclude Include="Src\OpenCL.h" />
<ClInclude Include="Src\Plugin.h" />
<ClInclude Include="Src\PluginDSP.h" />
<ClInclude Include="Src\PluginVideo.h" />
<ClInclude Include="Src\VideoBackendBase.h" />
<ClInclude Include="Src\SDCardUtil.h" />
<ClInclude Include="Src\Setup.h" />
<ClInclude Include="Src\stdafx.h" />
-166
View File
@@ -1,166 +0,0 @@
// Copyright (C) 2003 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/
/*
All plugins from Core > Plugins are loaded and unloaded with this class when
Dolpin is started and stopped.
*/
#include <string.h> // System
#ifdef _WIN32
#include <windows.h>
#else
#include <dlfcn.h>
#include <stdio.h>
#endif
#include "Common.h" // Local
#include "FileUtil.h"
#include "StringUtil.h"
#include "DynamicLibrary.h"
DynamicLibrary::DynamicLibrary()
{
library = 0;
}
// Gets the last dll error as string
const char *DllGetLastError()
{
#ifdef _WIN32
return GetLastErrorMsg();
#else // not win32
return dlerror();
#endif // WIN32
}
/* Loads the dll with LoadLibrary() or dlopen. This function is called on
start to scan for plugin, and before opening the Config and Debugging
windows. It is also called from core to load the plugins when the
emulation starts.
Returns 0 on failure and 1 on success
TODO: think about implementing some sort of cache for the plugin info.
*/
int DynamicLibrary::Load(const char* filename)
{
std::string LibraryPath = File::GetPluginsDirectory() + filename;
filename = LibraryPath.c_str();
INFO_LOG(COMMON, "DL: Loading dynamic library %s", filename);
if (!filename || strlen(filename) == 0) {
ERROR_LOG(COMMON, "DL: Missing filename to load");
return 0;
}
if (IsLoaded()) {
INFO_LOG(COMMON, "DL: library %s already loaded", filename);
return 1;
}
#ifdef _WIN32
library = LoadLibrary(filename);
#elif defined __linux__
// RTLD_NOW: resolve all symbols on load
// RTLD_LOCAL: don't resolve symbols for other libraries
library = dlopen(filename, RTLD_NOW | RTLD_LOCAL);
#else
library = dlopen(NULL, RTLD_LAZY);
#endif
DEBUG_LOG(COMMON, "DL: LoadLibrary: %s(%p)", filename, library);
if (!library) {
ERROR_LOG(COMMON, "DL: Error loading DLL %s: %s", filename,
DllGetLastError());
return 0;
}
library_file = filename;
INFO_LOG(COMMON, "DL: Done loading dynamic library %s", filename);
return 1;
}
/* Frees one instances of the dynamic library. Note that on most systems use
reference count to decide when to actually remove the library from memory.
Return 0 on failure and 1 on success
*/
int DynamicLibrary::Unload()
{
INFO_LOG(COMMON, "DL: Unloading dynamic library %s", library_file.c_str());
int retval;
if (!IsLoaded()) { // library != null
ERROR_LOG(COMMON, "DL: Unload failed for %s: not loaded",
library_file.c_str());
PanicAlert("DL: Unload failed %s: not loaded",
library_file.c_str());
return 0;
}
DEBUG_LOG(COMMON, "DL: FreeLibrary: %s %p\n",
library_file.c_str(), library);
#ifdef _WIN32
retval = FreeLibrary(library);
#else
retval = dlclose(library) ? 0 : 1;
#endif
if (! retval) {
ERROR_LOG(COMMON, "DL: Unload failed %s: %s",
library_file.c_str(), DllGetLastError());
}
library = 0;
INFO_LOG(COMMON, "DL: Done unloading dynamic library %s",
library_file.c_str());
return retval;
}
// Returns the address where symbol funcname is loaded or NULL on failure
void* DynamicLibrary::Get(const char* funcname) const
{
void* retval;
INFO_LOG(COMMON, "DL: Getting symbol %s: %s", library_file.c_str(),
funcname);
if (!library)
{
ERROR_LOG(COMMON, "DL: Get failed %s - Library not loaded", funcname);
return NULL;
}
#ifdef _WIN32
retval = GetProcAddress(library, funcname);
#else
retval = dlsym(library, funcname);
#endif
if (!retval)
{
WARN_LOG(COMMON, "DL: Symbol %s missing in %s (error: %s)\n",
funcname, library_file.c_str(), DllGetLastError());
}
INFO_LOG(COMMON, "DL: Done getting symbol %s: %s", library_file.c_str(),
funcname);
return retval;
}
-59
View File
@@ -1,59 +0,0 @@
// Copyright (C) 2003 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 _DYNAMICLIBRARY_H_
#define _DYNAMICLIBRARY_H_
#ifdef _WIN32
#include <windows.h>
#endif
#include <string>
/* Abstracts the (few) differences between dynamically loading DLLs under
Windows and .so / .dylib under Linux/MacOSX. */
class DynamicLibrary
{
public:
DynamicLibrary();
// Loads the library filename
int Load(const char *filename);
// Unload the current library
int Unload();
// Gets a pointer to the function symbol of funcname by getting it from the
// shared object
void *Get(const char *funcname) const;
// Returns true if the library is loaded
bool IsLoaded() const { return library != 0; }
private:
// name of the library file
std::string library_file;
// Library handle
#ifdef _WIN32
HINSTANCE library;
#else
void *library;
#endif
};
#endif // _DYNAMICLIBRARY_H_
-135
View File
@@ -1,135 +0,0 @@
// Copyright (C) 2003 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/
// --------------------------------------------------------------------------------------------
// This is the common Plugin class that links to the functions that are
// common to all plugins. This class is inherited by all plugin classes. But it's only created
// directly in PluginManager.cpp when we check if a plugin is valid or not.
// --------------------------------------------------------------------------------------------
#include "Plugin.h"
namespace Common
{
CPlugin::~CPlugin()
{
m_hInstLib.Unload();
}
CPlugin::CPlugin(const char* _szName) : valid(false)
{
m_GetDllInfo = NULL;
m_DllConfig = NULL;
m_DllDebugger = NULL;
m_SetDllGlobals = NULL;
m_Initialize = NULL;
m_Shutdown = NULL;
m_DoState = NULL;
m_EmuStateChange = NULL;
if (m_hInstLib.Load(_szName))
{
m_GetDllInfo = reinterpret_cast<TGetDllInfo>
(m_hInstLib.Get("GetDllInfo"));
m_DllConfig = reinterpret_cast<TDllConfig>
(m_hInstLib.Get("DllConfig"));
m_DllDebugger = reinterpret_cast<TDllDebugger>
(m_hInstLib.Get("DllDebugger"));
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"));
m_EmuStateChange = reinterpret_cast<TEmuStateChange>
(m_hInstLib.Get("EmuStateChange"));
// Check if the plugin has all the functions it should have
if (m_GetDllInfo != 0 &&
m_DllConfig != 0 &&
m_DllDebugger != 0 &&
m_SetDllGlobals != 0 &&
m_Initialize != 0 &&
m_Shutdown != 0 &&
m_DoState != 0 &&
m_EmuStateChange != 0)
valid = true;
}
// Save the filename for this plugin
Filename = _szName;
}
void *CPlugin::LoadSymbol(const char *sym)
{
return m_hInstLib.Get(sym);
}
// GetInfo: Get DLL info
bool CPlugin::GetInfo(PLUGIN_INFO& _pluginInfo)
{
if (m_GetDllInfo != NULL) {
m_GetDllInfo(&_pluginInfo);
return true;
}
return false;
}
// Config: Open the Config window
void CPlugin::Config(void *_hwnd)
{
if (m_DllConfig != NULL)
m_DllConfig(_hwnd);
}
// Debug: Open the Debugging window
void *CPlugin::Debug(void *Parent, bool Show)
{
return m_DllDebugger(Parent, Show);
}
void CPlugin::SetGlobals(PLUGIN_GLOBALS* _pluginGlobals) {
if (m_SetDllGlobals != NULL)
m_SetDllGlobals(_pluginGlobals);
}
void CPlugin::DoState(unsigned char **ptr, int mode) {
if (m_DoState != NULL)
m_DoState(ptr, mode);
}
void CPlugin::EmuStateChange(PLUGIN_EMUSTATE newState) {
if (m_EmuStateChange != NULL)
m_EmuStateChange(newState);
}
void CPlugin::Initialize(void *init)
{
if (m_Initialize != NULL)
m_Initialize(init);
}
void CPlugin::Shutdown()
{
if (m_Shutdown != NULL)
m_Shutdown();
}
} // Namespace
-75
View File
@@ -1,75 +0,0 @@
// Copyright (C) 2003 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_H_
#define _PLUGIN_H_
#include "Common.h"
#include "PluginSpecs.h"
#include "DynamicLibrary.h"
namespace Common
{
typedef void (__cdecl * TGetDllInfo)(PLUGIN_INFO*);
typedef void (__cdecl * TDllConfig)(void *);
typedef void* (__cdecl * TDllDebugger)(void *, bool);
typedef void (__cdecl * TSetDllGlobals)(PLUGIN_GLOBALS*);
typedef void (__cdecl * TInitialize)(void *);
typedef void (__cdecl * TShutdown)();
typedef void (__cdecl * TDoState)(unsigned char**, int);
typedef void (__cdecl * TEmuStateChange)(PLUGIN_EMUSTATE);
class CPlugin
{
public:
CPlugin(const char* _szName);
virtual ~CPlugin();
// This functions is only used when CPlugin is called directly, when a parent class like PluginVideo
// is called its own IsValid() will be called.
virtual bool IsValid() { return valid; };
const std::string& GetFilename() const { return Filename; }
bool GetInfo(PLUGIN_INFO& _pluginInfo);
void SetGlobals(PLUGIN_GLOBALS* _PluginGlobals);
void *LoadSymbol(const char *sym);
void Config(void *_hwnd);
void About(void *_hwnd);
void *Debug(void *Parent, bool Show);
void DoState(unsigned char **ptr, int mode);
void EmuStateChange(PLUGIN_EMUSTATE newState);
void Initialize(void *init);
void Shutdown();
private:
DynamicLibrary m_hInstLib;
std::string Filename;
bool valid;
// Functions
TGetDllInfo m_GetDllInfo;
TDllConfig m_DllConfig;
TDllDebugger m_DllDebugger;
TSetDllGlobals m_SetDllGlobals;
TInitialize m_Initialize;
TShutdown m_Shutdown;
TDoState m_DoState;
TEmuStateChange m_EmuStateChange;
};
} // Namespace
#endif // _PLUGIN_H_
-104
View File
@@ -1,104 +0,0 @@
// Copyright (C) 2003 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 "PluginVideo.h"
namespace Common
{
PluginVideo::PluginVideo(const char *_Filename) : CPlugin(_Filename), validVideo(false)
{
Video_Prepare = 0;
Video_BeginField = 0;
Video_EndField = 0;
Video_EnterLoop = 0;
Video_ExitLoop = 0;
Video_Screenshot = 0;
Video_AddMessage = 0;
Video_AccessEFB = 0;
Video_SetRendering = 0;
Video_CommandProcessorRead16 = 0;
Video_CommandProcessorWrite16 = 0;
Video_PixelEngineRead16 = 0;
Video_PixelEngineWrite16 = 0;
Video_PixelEngineWrite32 = 0;
Video_GatherPipeBursted = 0;
Video_WaitForFrameFinish = 0;
Video_IsFifoBusy = 0;
Video_AbortFrame = 0;
Video_Prepare = reinterpret_cast<TVideo_Prepare>
(LoadSymbol("Video_Prepare"));
Video_BeginField = reinterpret_cast<TVideo_BeginField>
(LoadSymbol("Video_BeginField"));
Video_EndField = reinterpret_cast<TVideo_EndField>
(LoadSymbol("Video_EndField"));
Video_Screenshot = reinterpret_cast<TVideo_Screenshot>
(LoadSymbol("Video_Screenshot"));
Video_EnterLoop = reinterpret_cast<TVideo_EnterLoop>
(LoadSymbol("Video_EnterLoop"));
Video_ExitLoop = reinterpret_cast<TVideo_ExitLoop>
(LoadSymbol("Video_ExitLoop"));
Video_AddMessage = reinterpret_cast<TVideo_AddMessage>
(LoadSymbol("Video_AddMessage"));
Video_AccessEFB = reinterpret_cast<TVideo_AccessEFB>
(LoadSymbol("Video_AccessEFB"));
Video_SetRendering = reinterpret_cast<TVideo_SetRendering>
(LoadSymbol("Video_SetRendering"));
Video_CommandProcessorRead16 = reinterpret_cast<TVideo_Read16>
(LoadSymbol("Video_CommandProcessorRead16"));
Video_CommandProcessorWrite16 = reinterpret_cast<TVideo_Write16>
(LoadSymbol("Video_CommandProcessorWrite16"));
Video_PixelEngineRead16 = reinterpret_cast<TVideo_Read16>
(LoadSymbol("Video_PixelEngineRead16"));
Video_PixelEngineWrite16 = reinterpret_cast<TVideo_Write16>
(LoadSymbol("Video_PixelEngineWrite16"));
Video_PixelEngineWrite32 = reinterpret_cast<TVideo_Write32>
(LoadSymbol("Video_PixelEngineWrite32"));
Video_GatherPipeBursted = reinterpret_cast<TVideo_GatherPipeBursted>
(LoadSymbol("Video_GatherPipeBursted"));
Video_WaitForFrameFinish = reinterpret_cast<TVideo_WaitForFrameFinish>
(LoadSymbol("Video_WaitForFrameFinish"));
Video_IsFifoBusy = reinterpret_cast<TVideo_IsFifoBusy>
(LoadSymbol("Video_IsFifoBusy"));
Video_AbortFrame = reinterpret_cast<TVideo_AbortFrame>
(LoadSymbol("Video_AbortFrame"));
if ((Video_Prepare != 0) &&
(Video_BeginField != 0) &&
(Video_EndField != 0) &&
(Video_EnterLoop != 0) &&
(Video_ExitLoop != 0) &&
(Video_Screenshot != 0) &&
(Video_AddMessage != 0) &&
(Video_SetRendering != 0) &&
(Video_AccessEFB != 0) &&
(Video_SetRendering != 0) &&
(Video_CommandProcessorRead16 != 0) &&
(Video_CommandProcessorWrite16 != 0) &&
(Video_PixelEngineRead16 != 0) &&
(Video_PixelEngineWrite16 != 0) &&
(Video_PixelEngineWrite32 != 0) &&
(Video_GatherPipeBursted != 0) &&
(Video_WaitForFrameFinish != 0) &&
(Video_IsFifoBusy != 0) &&
(Video_AbortFrame != 0))
validVideo = true;
}
PluginVideo::~PluginVideo() {}
} // namespace
-79
View File
@@ -1,79 +0,0 @@
// Copyright (C) 2003 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 _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_BeginField)(u32, FieldType, u32, u32);
typedef void (__cdecl* TVideo_EndField)();
typedef void (__cdecl* TVideo_Screenshot)(const char* filename);
typedef void (__cdecl* TVideo_EnterLoop)();
typedef void (__cdecl* TVideo_ExitLoop)();
typedef void (__cdecl* TVideo_SetRendering)(bool bEnabled);
typedef void (__cdecl* TVideo_AddMessage)(const char* pstr, unsigned int milliseconds);
typedef u32 (__cdecl* TVideo_AccessEFB)(EFBAccessType, u32, u32, u32);
typedef void (__cdecl* TVideo_Read16)(u16& _rReturnValue, const u32 _Address);
typedef void (__cdecl* TVideo_Write16)(const u16 _Data, const u32 _Address);
typedef void (__cdecl* TVideo_Read32)(u32& _rReturnValue, const u32 _Address);
typedef void (__cdecl* TVideo_Write32)(const u32 _Data, const u32 _Address);
typedef void (__cdecl* TVideo_GatherPipeBursted)();
typedef void (__cdecl* TVideo_WaitForFrameFinish)();
typedef bool (__cdecl* TVideo_IsFifoBusy)();
typedef void (__cdecl* TVideo_AbortFrame)();
class PluginVideo : public CPlugin
{
public:
PluginVideo(const char *_Filename);
virtual ~PluginVideo();
virtual bool IsValid() {return validVideo;};
TVideo_Prepare Video_Prepare;
TVideo_EnterLoop Video_EnterLoop;
TVideo_ExitLoop Video_ExitLoop;
TVideo_BeginField Video_BeginField;
TVideo_EndField Video_EndField;
TVideo_AccessEFB Video_AccessEFB;
TVideo_AddMessage Video_AddMessage;
TVideo_Screenshot Video_Screenshot;
TVideo_SetRendering Video_SetRendering;
TVideo_Read16 Video_CommandProcessorRead16;
TVideo_Write16 Video_CommandProcessorWrite16;
TVideo_Read16 Video_PixelEngineRead16;
TVideo_Write16 Video_PixelEngineWrite16;
TVideo_Write32 Video_PixelEngineWrite32;
TVideo_GatherPipeBursted Video_GatherPipeBursted;
TVideo_WaitForFrameFinish Video_WaitForFrameFinish;
TVideo_IsFifoBusy Video_IsFifoBusy;
TVideo_AbortFrame Video_AbortFrame;
private:
bool validVideo;
};
} // namespace
#endif // _PLUGINVIDEO_H_
@@ -0,0 +1,58 @@
// Copyright (C) 2003 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 "VideoBackendBase.h"
// TODO: ugly
#ifdef _WIN32
#include "../Plugins/Plugin_VideoDX9/Src/VideoBackend.h"
#include "../Plugins/Plugin_VideoDX11/Src/VideoBackend.h"
#endif
#include "../Plugins/Plugin_VideoOGL/Src/VideoBackend.h"
//#include "../Plugins/Plugin_VideoSoftware/Src/VideoBackend.h"
std::vector<VideoBackend*> g_available_video_backends;
VideoBackend* g_video_backend = NULL;
void VideoBackend::PopulateList()
{
#ifdef _WIN32
g_available_video_backends.push_back(new DX9::VideoBackend);
// TODO: if (winver >= VISTA) :p
g_available_video_backends.push_back(new DX11::VideoBackend);
#endif
g_available_video_backends.push_back(new OGL::VideoBackend);
//g_available_video_backends.push_back(new SW::VideoBackend);
g_video_backend = g_available_video_backends.front();
}
void VideoBackend::ClearList()
{
while (!g_available_video_backends.empty())
{
delete g_available_video_backends.back();
g_available_video_backends.pop_back();
}
}
void VideoBackend::ActivateBackend(const std::string& name)
{
for (std::vector<VideoBackend*>::const_iterator it = g_available_video_backends.begin(); it != g_available_video_backends.end(); ++it)
if (name == (*it)->GetName())
g_video_backend = *it;
}
+156
View File
@@ -0,0 +1,156 @@
// Copyright (C) 2003 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 VIDEO_BACKEND_H_
#define VIDEO_BACKEND_H_
#include <string>
#include <vector>
#include "PluginSpecs.h"
#include "ChunkFile.h"
enum FieldType
{
FIELD_PROGRESSIVE = 0,
FIELD_UPPER,
FIELD_LOWER
};
enum EFBAccessType
{
PEEK_Z = 0,
POKE_Z,
PEEK_COLOR,
POKE_COLOR
};
struct SCPFifoStruct
{
// fifo registers
volatile u32 CPBase;
volatile u32 CPEnd;
u32 CPHiWatermark;
u32 CPLoWatermark;
volatile u32 CPReadWriteDistance;
volatile u32 CPWritePointer;
volatile u32 CPReadPointer;
volatile u32 CPBreakpoint;
// Super Monkey Ball Adventure require this.
// Because the read&check-PEToken-loop stays in its JITed block I suppose.
// So no possiblity to ack the Token irq by the scheduler until some sort of PPC watchdog do its mess.
volatile u16 PEToken;
volatile u32 bFF_GPReadEnable;
volatile u32 bFF_BPEnable;
volatile u32 bFF_BPInt;
volatile u32 bFF_Breakpoint;
volatile u32 CPCmdIdle;
volatile u32 CPReadIdle;
volatile u32 bFF_LoWatermarkInt;
volatile u32 bFF_HiWatermarkInt;
volatile u32 bFF_LoWatermark;
volatile u32 bFF_HiWatermark;
// for GP watchdog hack
volatile u32 Fake_GPWDToken; // cicular incrementer
};
class VideoBackend
{
public:
virtual ~VideoBackend() {}
virtual void EmuStateChange(PLUGIN_EMUSTATE) = 0;
virtual void UpdateFPSDisplay(const char*) = 0;
virtual unsigned int PeekMessages() = 0;
virtual void Initialize() = 0;
virtual void Shutdown() = 0;
virtual void DoState(PointerWrap &p) = 0;
virtual std::string GetName() = 0;
virtual void ShowConfig(void*) {}
virtual void Video_Prepare() = 0;
virtual void Video_EnterLoop() = 0;
virtual void Video_ExitLoop() = 0;
virtual void Video_BeginField(u32, FieldType, u32, u32) = 0;
virtual void Video_EndField() = 0;
virtual u32 Video_AccessEFB(EFBAccessType, u32, u32, u32) = 0;
virtual void Video_AddMessage(const char* pstr, unsigned int milliseconds) = 0;
virtual bool Video_Screenshot(const char* filename) = 0;
virtual void Video_SetRendering(bool bEnabled) = 0;
static void Video_GatherPipeBursted();
virtual void Video_WaitForFrameFinish() = 0;
virtual bool Video_IsFifoBusy() = 0;
virtual void Video_AbortFrame() = 0;
static void PopulateList();
static void ClearList();
static void ActivateBackend(const std::string& name);
};
extern std::vector<VideoBackend*> g_available_video_backends;
extern VideoBackend* g_video_backend;
// inherited by dx9/dx11/ogl backends
class VideoBackendHLE : public VideoBackend
{
void DoState(PointerWrap &p);
void EmuStateChange(PLUGIN_EMUSTATE);
void Video_EnterLoop();
void Video_ExitLoop();
void Video_BeginField(u32, FieldType, u32, u32);
void Video_EndField();
u32 Video_AccessEFB(EFBAccessType, u32, u32, u32);
void Video_AddMessage(const char* pstr, unsigned int milliseconds);
bool Video_Screenshot(const char* filename);
void Video_SetRendering(bool bEnabled);
void Video_WaitForFrameFinish();
bool Video_IsFifoBusy();
void Video_AbortFrame();
};
// inherited by software renderer
class VideoBackendLLE : public VideoBackend
{
};
#endif
+7 -15
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Version="9.00"
Name="Core"
ProjectGUID="{F0B874CB-4476-4199-9315-8343D05AE684}"
RootNamespace="Core"
@@ -45,7 +45,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\VideoCommon\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -116,7 +116,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\VideoCommon\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -191,7 +191,7 @@
FavorSizeOrSpeed="1"
OmitFramePointers="true"
EnableFiberSafeOptimizations="false"
AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\VideoCommon\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
StringPooling="true"
RuntimeLibrary="0"
@@ -269,7 +269,7 @@
OmitFramePointers="true"
EnableFiberSafeOptimizations="false"
WholeProgramOptimization="false"
AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\VideoCommon\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
StringPooling="true"
RuntimeLibrary="0"
@@ -344,7 +344,7 @@
FavorSizeOrSpeed="1"
OmitFramePointers="true"
EnableFiberSafeOptimizations="false"
AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\VideoCommon\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
PreprocessorDefinitions="NDEBUG;_LIB;DEBUGFAST;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
RuntimeLibrary="0"
BufferSecurityCheck="true"
@@ -419,7 +419,7 @@
FavorSizeOrSpeed="1"
OmitFramePointers="true"
EnableFiberSafeOptimizations="false"
AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
AdditionalIncludeDirectories=".\Src;.\Core\Core\Src;.\Core\Core\Src\Debugger;..\Common\Src;..\VideoCommon\Src;..\DiscIO\Src;..\AudioCommon\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
PreprocessorDefinitions="NDEBUG;_LIB;DEBUGFAST;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
RuntimeLibrary="0"
BufferSecurityCheck="false"
@@ -1981,14 +1981,6 @@
RelativePath=".\Src\PluginDSP.h"
>
</File>
<File
RelativePath=".\Src\PluginManager.cpp"
>
</File>
<File
RelativePath=".\Src\PluginManager.h"
>
</File>
<File
RelativePath=".\Src\SConscript"
>
+59 -9
View File
@@ -127,7 +127,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\Src;..\Common\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\PluginSpecs;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;..\..\..\Externals\Lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>.\Src;..\Common\Src;..\VideoCommon\Src;..\AudioCommon\Src;..\DSPCore\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\PluginSpecs;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;..\..\..\Externals\Lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
@@ -146,7 +146,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\Src;..\Common\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\PluginSpecs;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;..\..\..\Externals\Lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>.\Src;..\Common\Src;..\VideoCommon\Src;..\AudioCommon\Src;..\DSPCore\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\PluginSpecs;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;..\..\..\Externals\Lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
@@ -167,7 +167,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>.\Src;..\Common\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\PluginSpecs;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;..\..\..\Externals\Lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>.\Src;..\Common\Src;..\VideoCommon\Src;..\AudioCommon\Src;..\DSPCore\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\PluginSpecs;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;..\..\..\Externals\Lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<ShowIncludes>false</ShowIncludes>
@@ -191,7 +191,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>.\Src;..\Common\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\PluginSpecs;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;..\..\..\Externals\Lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>.\Src;..\Common\Src;..\VideoCommon\Src;..\AudioCommon\Src;..\DSPCore\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\PluginSpecs;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;..\..\..\Externals\Lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DEBUGFAST;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<ShowIncludes>false</ShowIncludes>
@@ -215,7 +215,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>.\Src;..\Common\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\PluginSpecs;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;..\..\..\Externals\Lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>.\Src;..\Common\Src;..\VideoCommon\Src;..\AudioCommon\Src;..\DSPCore\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\PluginSpecs;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;..\..\..\Externals\Lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<ShowIncludes>false</ShowIncludes>
@@ -239,7 +239,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>.\Src;..\Common\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\PluginSpecs;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;..\..\..\Externals\Lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>.\Src;..\Common\Src;..\VideoCommon\Src;..\AudioCommon\Src;..\DSPCore\Src;..\DiscIO\Src;..\InputCommon\Src;..\wiiuse\Src;..\..\PluginSpecs;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\SFML\include;..\..\..\Externals\LZO;..\..\..\Externals\zlib;..\..\..\Externals\Lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DEBUGFAST;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<ShowIncludes>false</ShowIncludes>
@@ -313,6 +313,26 @@
<ClCompile Include="Src\HW\BBA-TAP\TAP_Win32.cpp" />
<ClCompile Include="Src\HW\CPU.cpp" />
<ClCompile Include="Src\HW\DSP.cpp" />
<ClCompile Include="Src\HW\DSPHLE\DSPHLE.cpp" />
<ClCompile Include="Src\HW\DSPHLE\HLEMixer.cpp" />
<ClCompile Include="Src\HW\DSPHLE\MailHandler.cpp" />
<ClCompile Include="Src\HW\DSPHLE\UCodes\UCodes.cpp" />
<ClCompile Include="Src\HW\DSPHLE\UCodes\UCode_AX.cpp" />
<ClCompile Include="Src\HW\DSPHLE\UCodes\UCode_AXWii.cpp" />
<ClCompile Include="Src\HW\DSPHLE\UCodes\UCode_CARD.cpp" />
<ClCompile Include="Src\HW\DSPHLE\UCodes\UCode_GBA.cpp" />
<ClCompile Include="Src\HW\DSPHLE\UCodes\UCode_InitAudioSystem.cpp" />
<ClCompile Include="Src\HW\DSPHLE\UCodes\UCode_ROM.cpp" />
<ClCompile Include="Src\HW\DSPHLE\UCodes\UCode_Zelda.cpp" />
<ClCompile Include="Src\HW\DSPHLE\UCodes\UCode_Zelda_ADPCM.cpp" />
<ClCompile Include="Src\HW\DSPHLE\UCodes\UCode_Zelda_Synth.cpp" />
<ClCompile Include="Src\HW\DSPHLE\UCodes\UCode_Zelda_Voice.cpp" />
<ClCompile Include="Src\HW\DSPLLE\DSPDebugInterface.cpp" />
<ClCompile Include="Src\HW\DSPLLE\DSPHost.cpp" />
<ClCompile Include="Src\HW\DSPLLE\DSPLLE.cpp" />
<ClCompile Include="Src\HW\DSPLLE\DSPLLEGlobals.cpp" />
<ClCompile Include="Src\HW\DSPLLE\DSPLLETools.cpp" />
<ClCompile Include="Src\HW\DSPLLE\DSPSymbols.cpp" />
<ClCompile Include="Src\HW\DVDInterface.cpp" />
<ClCompile Include="Src\HW\EXI.cpp" />
<ClCompile Include="Src\HW\EXI_Channel.cpp" />
@@ -371,7 +391,7 @@
<ClCompile Include="Src\MemTools.cpp" />
<ClCompile Include="Src\OnFrame.cpp" />
<ClCompile Include="Src\PatchEngine.cpp" />
<ClCompile Include="Src\PluginManager.cpp" />
<ClCompile Include="Src\PluginDSP.cpp" />
<ClCompile Include="Src\PowerPC\Interpreter\Interpreter.cpp" />
<ClCompile Include="Src\PowerPC\Interpreter\Interpreter_Branch.cpp" />
<ClCompile Include="Src\PowerPC\Interpreter\Interpreter_FloatingPoint.cpp" />
@@ -481,6 +501,26 @@
<ClInclude Include="Src\HW\BBA-TAP\TAP_Win32.h" />
<ClInclude Include="Src\HW\CPU.h" />
<ClInclude Include="Src\HW\DSP.h" />
<ClInclude Include="Src\HW\DSPHLE\DSPHLE.h" />
<ClInclude Include="Src\HW\DSPHLE\DSPHLEGlobals.h" />
<ClInclude Include="Src\HW\DSPHLE\HLEMixer.h" />
<ClInclude Include="Src\HW\DSPHLE\MailHandler.h" />
<ClInclude Include="Src\HW\DSPHLE\UCodes\UCodes.h" />
<ClInclude Include="Src\HW\DSPHLE\UCodes\UCode_AX.h" />
<ClInclude Include="Src\HW\DSPHLE\UCodes\UCode_AXStructs.h" />
<ClInclude Include="Src\HW\DSPHLE\UCodes\UCode_AXWii.h" />
<ClInclude Include="Src\HW\DSPHLE\UCodes\UCode_AX_ADPCM.h" />
<ClInclude Include="Src\HW\DSPHLE\UCodes\UCode_AX_Voice.h" />
<ClInclude Include="Src\HW\DSPHLE\UCodes\UCode_CARD.h" />
<ClInclude Include="Src\HW\DSPHLE\UCodes\UCode_GBA.h" />
<ClInclude Include="Src\HW\DSPHLE\UCodes\UCode_InitAudioSystem.h" />
<ClInclude Include="Src\HW\DSPHLE\UCodes\UCode_ROM.h" />
<ClInclude Include="Src\HW\DSPHLE\UCodes\UCode_Zelda.h" />
<ClInclude Include="Src\HW\DSPLLE\DSPDebugInterface.h" />
<ClInclude Include="Src\HW\DSPLLE\DSPLLE.h" />
<ClInclude Include="Src\HW\DSPLLE\DSPLLEGlobals.h" />
<ClInclude Include="Src\HW\DSPLLE\DSPLLETools.h" />
<ClInclude Include="Src\HW\DSPLLE\DSPSymbols.h" />
<ClInclude Include="Src\HW\DVDInterface.h" />
<ClInclude Include="Src\HW\EXI.h" />
<ClInclude Include="Src\HW\EXI_Channel.h" />
@@ -543,7 +583,7 @@
<ClInclude Include="Src\MemTools.h" />
<ClInclude Include="Src\OnFrame.h" />
<ClInclude Include="Src\PatchEngine.h" />
<ClInclude Include="Src\PluginManager.h" />
<ClInclude Include="Src\PluginDSP.h" />
<ClInclude Include="Src\PowerPC\CPUCoreBase.h" />
<ClInclude Include="Src\PowerPC\Gekko.h" />
<ClInclude Include="Src\PowerPC\Interpreter\Interpreter.h" />
@@ -576,20 +616,30 @@
<ClInclude Include="Src\VolumeHandler.h" />
</ItemGroup>
<ItemGroup>
<None Include="Src\HW\DSPHLE\UCodes\UCode_Zelda_Obsolete.txt" />
<None Include="Src\SConscript" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Externals\Bochs_disasm\Bochs_disasm.vcxproj">
<Project>{cd3d4c3c-1027-4d33-b047-aec7b56d0bf6}</Project>
</ProjectReference>
<ProjectReference Include="..\AudioCommon\AudioCommon.vcxproj">
<Project>{37d007bd-d66c-4eaf-b56c-bd1aac340a05}</Project>
</ProjectReference>
<ProjectReference Include="..\Common\Common.vcxproj">
<Project>{c87a4178-44f6-49b2-b7aa-c79af1b8c534}</Project>
</ProjectReference>
<ProjectReference Include="..\DiscIO\DiscIO.vcxproj">
<Project>{b6398059-ebb6-4c34-b547-95f365b71ff4}</Project>
</ProjectReference>
<ProjectReference Include="..\DSPCore\DSPCore.vcxproj">
<Project>{4ed3c8be-91a7-4361-8d46-16d03b678d4c}</Project>
</ProjectReference>
<ProjectReference Include="..\VideoCommon\VideoCommon.vcxproj">
<Project>{3e5c4e02-1ba9-4776-bdbe-e3f91ffa34cf}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
+2 -1
View File
@@ -21,7 +21,6 @@
#include "CommonPaths.h"
#include "IniFile.h"
#include "ConfigManager.h"
#include "PluginManager.h"
#include "FileUtil.h"
SConfig* SConfig::m_Instance;
@@ -184,6 +183,7 @@ void SConfig::SaveSettings()
ini.Set("Core", "UseFPS", b_UseFPS);
// Plugins
// TODO: change key name, it's no longer a plugin
ini.Set("Core", "GFXPlugin", m_LocalCoreStartupParameter.m_strVideoPlugin);
ini.Save(File::GetUserPath(F_DOLPHINCONFIG_IDX));
@@ -318,6 +318,7 @@ void SConfig::LoadSettings()
ini.Get("Core", "UseFPS", &b_UseFPS, false); // use vps as default
// Plugins
// TODO: change key name, it's no longer a plugin
ini.Get("Core", "GFXPlugin", &m_LocalCoreStartupParameter.m_strVideoPlugin, m_DefaultGFXPlugin.c_str());
}
+26 -73
View File
@@ -54,9 +54,9 @@
#include "PowerPC/PowerPC.h"
#include "PowerPC/JitCommon/JitBase.h"
#include "PluginManager.h"
#include "PluginDSP.h"
#include "ConfigManager.h"
#include "VideoBackendBase.h"
#include "VolumeHandler.h"
#include "FileMonitor.h"
@@ -68,6 +68,9 @@
#include "State.h"
#include "OnFrame.h"
// TODO: ugly, remove
bool g_aspect_wide;
namespace Core
{
@@ -77,20 +80,11 @@ volatile u32 DrawnFrame = 0;
u32 DrawnVideo = 0;
// Function forwarding
void Callback_VideoGetWindowSize(int& x, int& y, int& width, int& height);
void Callback_VideoRequestWindowSize(int& width, int& height);
void Callback_VideoLog(const TCHAR* _szMessage, int _bDoBreak);
void Callback_VideoCopiedToXFB(bool video_update);
void Callback_DSPLog(const TCHAR* _szMessage, int _v);
const char *Callback_ISOName(void);
void Callback_DSPInterrupt();
void Callback_WiimoteInterruptChannel(int _number, u16 _channelID, const void* _pData, u32 _Size);
// For keyboard shortcuts.
void Callback_CoreMessage(int Id);
TPeekMessages Callback_PeekMessages = NULL;
TUpdateFPSDisplay g_pUpdateFPSDisplay = NULL;
// Function declarations
void EmuThread();
@@ -131,14 +125,12 @@ bool PanicAlertToVideo(const char* text, bool yes_no)
void DisplayMessage(const std::string &message, int time_in_ms)
{
CPluginManager::GetInstance().GetVideo()->Video_AddMessage(message.c_str(),
time_in_ms);
g_video_backend->Video_AddMessage(message.c_str(), time_in_ms);
}
void DisplayMessage(const char *message, int time_in_ms)
{
CPluginManager::GetInstance().GetVideo()->Video_AddMessage(message,
time_in_ms);
g_video_backend->Video_AddMessage(message, time_in_ms);
}
void Callback_DebuggerBreak()
@@ -176,19 +168,11 @@ bool Init()
return false;
}
// Get a handle to the current instance of the plugin manager
CPluginManager &pManager = CPluginManager::GetInstance();
SCoreStartupParameter &_CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
g_CoreStartupParameter = _CoreParameter;
g_CoreStartupParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
// FIXME DEBUG_LOG(BOOT, dump_params());
Host_SetWaitCursor(true);
// Load all needed plugins
if (!pManager.InitPlugins())
return false;
emuThreadGoing.Init();
// Start the emu thread
@@ -207,7 +191,7 @@ void Stop() // - Hammertime!
{
const SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
g_bStopping = true;
CPluginManager::GetInstance().EmuStateChange(PLUGIN_EMUSTATE_STOP);
g_video_backend->EmuStateChange(PLUGIN_EMUSTATE_STOP);
WARN_LOG(CONSOLE, "Stop [Main Thread]\t\t---- Shutting down ----");
@@ -226,7 +210,7 @@ void Stop() // - Hammertime!
// concurrently with the rest of the commands in this function. We no
// longer rely on Postmessage.
NOTICE_LOG(CONSOLE, "%s", StopMessage(true, "Wait for Video Loop to exit ...").c_str());
CPluginManager::GetInstance().GetVideo()->Video_ExitLoop();
g_video_backend->Video_ExitLoop();
// Wait until the CPU finishes exiting the main run loop
cpuRunloopQuit.Wait();
@@ -246,7 +230,6 @@ void Stop() // - Hammertime!
void CpuThread()
{
CPluginManager &Plugins = CPluginManager::GetInstance();
const SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
if (_CoreParameter.bCPUThread)
@@ -255,7 +238,7 @@ void CpuThread()
}
else
{
CPluginManager::GetInstance().GetVideo()->Video_Prepare();
g_video_backend->Video_Prepare();
Common::SetCurrentThreadName("CPU-GPU thread");
}
@@ -279,7 +262,7 @@ void CpuThread()
// So we have to call the shutdown from the thread that started it.
if (!_CoreParameter.bCPUThread)
{
Plugins.ShutdownVideoPlugin();
g_video_backend->Shutdown();
}
cpuRunloopQuit.Set();
@@ -299,7 +282,6 @@ void EmuThread()
Common::SetCurrentThreadName("Emuthread - starting");
const SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
CPluginManager &Plugins = CPluginManager::GetInstance();
if (_CoreParameter.bLockThreads)
{
if (cpu_info.num_cores > 3)
@@ -315,46 +297,19 @@ void EmuThread()
emuThreadGoing.Set();
// Load the VideoPlugin
SVideoInitialize VideoInitialize;
VideoInitialize.pGetMemoryPointer = Memory::GetPointer;
VideoInitialize.pSetInterrupt = ProcessorInterface::SetInterrupt;
VideoInitialize.pRegisterEvent = CoreTiming::RegisterEvent;
VideoInitialize.pScheduleEvent_Threadsafe = CoreTiming::ScheduleEvent_Threadsafe;
VideoInitialize.pRemoveEvent = CoreTiming::RemoveAllEvents;
VideoInitialize.pProcessFifoEvents = CoreTiming::ProcessFifoWaitEvents;
// This is first the m_Panel handle, then it is updated to have the new window handle
VideoInitialize.pWindowHandle = _CoreParameter.hMainWindow;
VideoInitialize.pLog = Callback_VideoLog;
VideoInitialize.pSysMessage = Host_SysMessage;
VideoInitialize.pGetWindowSize = Callback_VideoGetWindowSize;
VideoInitialize.pRequestWindowSize = Callback_VideoRequestWindowSize;
VideoInitialize.pCopiedToXFB = Callback_VideoCopiedToXFB;
VideoInitialize.pPeekMessages = NULL;
VideoInitialize.pUpdateFPSDisplay = NULL;
VideoInitialize.pMemoryBase = Memory::base;
VideoInitialize.pCoreMessage = Callback_CoreMessage;
VideoInitialize.pResetGatherPipe = GPFifo::ResetGatherPipe;
VideoInitialize.bWii = _CoreParameter.bWii;
VideoInitialize.bOnThread = _CoreParameter.bCPUThread;
VideoInitialize.Fifo_CPUBase = &ProcessorInterface::Fifo_CPUBase;
VideoInitialize.Fifo_CPUEnd = &ProcessorInterface::Fifo_CPUEnd;
VideoInitialize.Fifo_CPUWritePointer = &ProcessorInterface::Fifo_CPUWritePointer;
bool aspectWide = _CoreParameter.bWii;
if (aspectWide)
g_aspect_wide = _CoreParameter.bWii;
if (g_aspect_wide)
{
IniFile gameIni;
gameIni.Load(_CoreParameter.m_strGameIni.c_str());
gameIni.Get("Wii", "Widescreen", &aspectWide, !!SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.AR"));
gameIni.Get("Wii", "Widescreen", &g_aspect_wide, !!SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.AR"));
}
VideoInitialize.bAutoAspectIs16_9 = aspectWide;
Plugins.GetVideo()->Initialize(&VideoInitialize); // Call the dll
// Under linux, this is an X11 Window, not a HWND!
g_pWindowHandle = VideoInitialize.pWindowHandle;
Callback_PeekMessages = VideoInitialize.pPeekMessages;
g_pUpdateFPSDisplay = VideoInitialize.pUpdateFPSDisplay;
// _CoreParameter.hMainWindow is first the m_Panel handle, then it is updated to have the new window handle,
// within g_video_backend->Initialize()
// TODO: that's ugly, change Initialize() to take m_Panel and return the new window handle
g_video_backend->Initialize();
g_pWindowHandle = _CoreParameter.hMainWindow;
DSP::GetPlugin()->Initialize(g_pWindowHandle, _CoreParameter.bWii, _CoreParameter.bDSPThread);
@@ -395,7 +350,7 @@ void EmuThread()
// This thread, after creating the EmuWindow, spawns a CPU thread,
// and then takes over and becomes the video thread
Plugins.GetVideo()->Video_Prepare(); // wglMakeCurrent
g_video_backend->Video_Prepare(); // wglMakeCurrent
cpuThread = std::thread(CpuThread);
Common::SetCurrentThreadName("Video thread");
@@ -403,7 +358,7 @@ void EmuThread()
Host_UpdateDisasmDialog();
Host_UpdateMainFrame();
Plugins.GetVideo()->Video_EnterLoop();
g_video_backend->Video_EnterLoop();
}
else // SingleCore mode
{
@@ -423,8 +378,7 @@ void EmuThread()
// then we lose the powerdown check. ... unless powerdown sends a message :P
while (PowerPC::GetState() != PowerPC::CPU_POWERDOWN)
{
if (Callback_PeekMessages)
Callback_PeekMessages();
g_video_backend->PeekMessages();
Common::SleepCurrentThread(20);
}
@@ -465,7 +419,7 @@ void EmuThread()
WARN_LOG(CONSOLE, "%s", StopMessage(false, "Shutting down plugins").c_str());
// In single core mode, this has already been called.
if (_CoreParameter.bCPUThread)
Plugins.ShutdownVideoPlugin();
g_video_backend->Shutdown();
Pad::Shutdown();
Wiimote::Shutdown();
@@ -540,7 +494,7 @@ void ScreenShot(const std::string& name)
bool bPaused = (GetState() == CORE_PAUSE);
SetState(CORE_PAUSE);
CPluginManager::GetInstance().GetVideo()->Video_Screenshot(name.c_str());
g_video_backend->Video_Screenshot(name.c_str());
if(!bPaused)
SetState(CORE_RUN);
}
@@ -621,8 +575,7 @@ void VideoThrottle()
SMessage;
// Show message
if (g_pUpdateFPSDisplay != NULL)
g_pUpdateFPSDisplay(SMessage.c_str());
g_video_backend->UpdateFPSDisplay(SMessage.c_str());
if (_CoreParameter.bRenderToMain &&
SConfig::GetInstance().m_InterfaceStatusbar) {
@@ -658,7 +611,7 @@ bool report_slow(int skipped)
// Callback_VideoLog
// WARNING - THIS IS EXECUTED FROM VIDEO THREAD
void Callback_VideoLog(const TCHAR *_szMessage, int _bDoBreak)
void Callback_VideoLog(const char *_szMessage, int _bDoBreak)
{
INFO_LOG(VIDEO, "%s", _szMessage);
}
+7
View File
@@ -33,6 +33,13 @@
namespace Core
{
void Callback_VideoLog(const char* _szMessage, int _bDoBreak);
void Callback_VideoCopiedToXFB(bool video_update);
void Callback_VideoGetWindowSize(int& x, int& y, int& width, int& height);
void Callback_VideoRequestWindowSize(int& width, int& height);
void Callback_CoreMessage(int Id);
enum EState
{
CORE_UNINITIALIZED,
+2 -2
View File
@@ -22,7 +22,7 @@
#include "CoreTiming.h"
#include "Core.h"
#include "StringUtil.h"
#include "PluginManager.h"
#include "VideoBackendBase.h"
#define MAX_SLICE_LENGTH 20000
@@ -520,7 +520,7 @@ void Idle()
//When the FIFO is processing data we must not advance because in this way
//the VI will be desynchronized. So, We are waiting until the FIFO finish and
//while we process only the events required by the FIFO.
while (CPluginManager::GetInstance().GetVideo()->Video_IsFifoBusy())
while (g_video_backend->Video_IsFifoBusy())
{
ProcessFifoWaitEvents();
Common::YieldCPU();
+4 -7
View File
@@ -18,13 +18,12 @@
#include "Common.h"
#include "Thread.h"
#include "../PluginDSP.h"
#include "../PluginManager.h"
#include "../PowerPC/PowerPC.h"
#include "../Host.h"
#include "../Core.h"
#include "CPU.h"
#include "DSP.h"
#include "VideoBackendBase.h"
namespace
{
@@ -116,15 +115,13 @@ void CCPU::EnableStepping(const bool _bStepping)
if (_bStepping)
{
PowerPC::Pause();
CPluginManager::GetInstance().EmuStateChange(PLUGIN_EMUSTATE_PAUSE);
DSP::GetPlugin()->DSP_ClearAudioBuffer(true);
g_video_backend->EmuStateChange(PLUGIN_EMUSTATE_PAUSE);
}
else
{
PowerPC::Start();
m_StepEvent.Set();
CPluginManager::GetInstance().EmuStateChange(PLUGIN_EMUSTATE_PLAY);
DSP::GetPlugin()->DSP_ClearAudioBuffer(false);
g_video_backend->EmuStateChange(PLUGIN_EMUSTATE_PLAY);
}
}
-1
View File
@@ -45,7 +45,6 @@
#include "ProcessorInterface.h"
#include "AudioInterface.h"
#include "../PowerPC/PowerPC.h"
#include "../PluginManager.h"
#include "../ConfigManager.h"
#include "../PluginDSP.h"
+1
View File
@@ -29,6 +29,7 @@ public:
virtual void Initialize(void *hWnd, bool bWii, bool bDSPThread);
virtual void Shutdown();
virtual bool IsLLE() { return true; }
virtual void DoState(PointerWrap &p);
+4 -7
View File
@@ -18,10 +18,11 @@
#include "Common.h"
#include "ChunkFile.h"
#include "ProcessorInterface.h"
#include "../PluginManager.h"
#include "Memmap.h"
#include "../PowerPC/PowerPC.h"
#include "VideoBackendBase.h"
#include "GPFifo.h"
namespace GPFifo
@@ -42,9 +43,7 @@ namespace GPFifo
u8 GC_ALIGNED32(m_gatherPipe[GATHER_PIPE_SIZE*16]); //more room, for the fastmodes
// pipe counter
u32 m_gatherPipeCount = 0;
Common::TVideo_GatherPipeBursted m_GatherPipeBursted = NULL;
u32 m_gatherPipeCount = 0;
void DoState(PointerWrap &p)
{
@@ -55,7 +54,6 @@ void DoState(PointerWrap &p)
void Init()
{
ResetGatherPipe();
m_GatherPipeBursted = CPluginManager::GetInstance().GetVideo()->Video_GatherPipeBursted;
}
bool IsEmpty()
@@ -92,8 +90,7 @@ void STACKALIGN CheckGatherPipe()
ProcessorInterface::Fifo_CPUWritePointer += GATHER_PIPE_SIZE;
}
// Call pre-fetched pointer
m_GatherPipeBursted();
g_video_backend->Video_GatherPipeBursted();
}
// move back the spill bytes

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