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

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"
>

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" />

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;
}

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_

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

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_

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

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_

View File

@ -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;
}

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

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"
>

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>

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());
}

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);
}

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,

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();

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);
}
}

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"

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);

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

View File

@ -31,7 +31,6 @@
#include "AudioInterface.h"
#include "VideoInterface.h"
#include "WII_IPC.h"
#include "../PluginManager.h"
#include "../ConfigManager.h"
#include "../CoreTiming.h"
#include "SystemTimers.h"

View File

@ -39,14 +39,14 @@ may be redirected here (for example to Read_U32()).
#include "VideoInterface.h"
#include "SI.h"
#include "EXI.h"
#include "PluginVideo.h"
#include "AudioInterface.h"
#include "MemoryInterface.h"
#include "WII_IOB.h"
#include "WII_IPC.h"
#include "../ConfigManager.h"
#include "../Debugger/Debugger_SymbolMap.h"
#include "../PluginManager.h"
#include "CommandProcessor.h"
#include "PixelEngine.h"
namespace Memory
{
@ -180,12 +180,12 @@ void InitHWMemFuncs()
for (int i = 0; i < BLOCKSIZE; i++)
{
hwRead16 [CP_START+i] = CPluginManager::GetInstance().GetVideo()->Video_CommandProcessorRead16;
hwWrite16[CP_START+i] = CPluginManager::GetInstance().GetVideo()->Video_CommandProcessorWrite16;
hwRead16 [CP_START+i] = CommandProcessor::Read16;
hwWrite16[CP_START+i] = CommandProcessor::Write16;
hwRead16 [PE_START+i] = CPluginManager::GetInstance().GetVideo()->Video_PixelEngineRead16;
hwWrite16[PE_START+i] = CPluginManager::GetInstance().GetVideo()->Video_PixelEngineWrite16;
hwWrite32[PE_START+i] = CPluginManager::GetInstance().GetVideo()->Video_PixelEngineWrite32;
hwRead16 [PE_START+i] = PixelEngine::Read16;
hwWrite16[PE_START+i] = PixelEngine::Write16;
hwWrite32[PE_START+i] = PixelEngine::Write32;
hwRead8 [VI_START+i] = VideoInterface::Read8;
hwRead16 [VI_START+i] = VideoInterface::Read16;
@ -253,12 +253,12 @@ void InitHWMemFuncsWii()
// MI, PI, DSP are still mapped to 0xCCxxxxxx
for (int i = 0; i < BLOCKSIZE; i++)
{
hwRead16 [CP_START+i] = CPluginManager::GetInstance().GetVideo()->Video_CommandProcessorRead16;
hwWrite16[CP_START+i] = CPluginManager::GetInstance().GetVideo()->Video_CommandProcessorWrite16;
hwRead16 [CP_START+i] = CommandProcessor::Read16;
hwWrite16[CP_START+i] = CommandProcessor::Write16;
hwRead16 [PE_START+i] = CPluginManager::GetInstance().GetVideo()->Video_PixelEngineRead16;
hwWrite16[PE_START+i] = CPluginManager::GetInstance().GetVideo()->Video_PixelEngineWrite16;
hwWrite32[PE_START+i] = CPluginManager::GetInstance().GetVideo()->Video_PixelEngineWrite32;
hwRead16 [PE_START+i] = PixelEngine::Read16;
hwWrite16[PE_START+i] = PixelEngine::Write16;
hwWrite32[PE_START+i] = PixelEngine::Write32;
hwRead16 [PI_START+i] = ProcessorInterface::Read16;
hwRead32 [PI_START+i] = ProcessorInterface::Read32;

View File

@ -23,7 +23,7 @@
#include "WII_IOB.h"
#include "../Core.h"
#include "../PowerPC/PowerPC.h"
#include "../PluginManager.h"
#include "VideoBackendBase.h"
namespace Memory
{
@ -133,10 +133,10 @@ u32 EFB_Read(const u32 addr)
int y = (addr >> 12) & 0x3ff;
if (addr & 0x00400000) {
var = CPluginManager::GetInstance().GetVideo()->Video_AccessEFB(PEEK_Z, x, y, 0);
var = g_video_backend->Video_AccessEFB(PEEK_Z, x, y, 0);
DEBUG_LOG(MEMMAP, "EFB Z Read @ %i, %i\t= 0x%08x", x, y, var);
} else {
var = CPluginManager::GetInstance().GetVideo()->Video_AccessEFB(PEEK_COLOR, x, y, 0);
var = g_video_backend->Video_AccessEFB(PEEK_COLOR, x, y, 0);
DEBUG_LOG(MEMMAP, "EFB Color Read @ %i, %i\t= 0x%08x", x, y, var);
}
@ -229,10 +229,10 @@ inline void WriteToHardware(u32 em_address, const T data, u32 effective_address,
int y = (em_address >> 12) & 0x3ff;
// TODO figure out a way to send data without falling into the template trap
if (em_address & 0x00400000) {
CPluginManager::GetInstance().GetVideo()->Video_AccessEFB(POKE_Z, x, y, (u32)data);
g_video_backend->Video_AccessEFB(POKE_Z, x, y, (u32)data);
DEBUG_LOG(MEMMAP, "EFB Z Write %08x @ %i, %i", (u32)data, x, y);
} else {
CPluginManager::GetInstance().GetVideo()->Video_AccessEFB(POKE_COLOR, x, y,(u32)data);
g_video_backend->Video_AccessEFB(POKE_COLOR, x, y,(u32)data);
DEBUG_LOG(MEMMAP, "EFB Color Write %08x @ %i, %i", (u32)data, x, y);
}
return;

View File

@ -25,7 +25,8 @@
#include "../CoreTiming.h"
#include "ProcessorInterface.h"
#include "GPFifo.h"
#include "../PluginManager.h"
#include "VideoBackendBase.h"
namespace ProcessorInterface
{
@ -190,7 +191,7 @@ void Write32(const u32 _uValue, const u32 _iAddress)
case PI_FIFO_RESET:
//Abort the actual frame
CPluginManager::GetInstance().GetVideo()->Video_AbortFrame();
g_video_backend->Video_AbortFrame();
//Fifo_CPUWritePointer = Fifo_CPUBase; ??
//PanicAlert("Unknown write to PI_FIFO_RESET (%08x)", _uValue);
WARN_LOG(PROCESSORINTERFACE, "Fifo reset (%08x)", _uValue);

View File

@ -23,8 +23,6 @@
#include "GCPadStatus.h"
#include "GCPad.h"
#include "../PluginManager.h" // for pad state
// where to put baseboard debug
#define AMBASEBOARDDEBUG OSREPORT

View File

@ -18,7 +18,6 @@
#ifndef _SI_DEVICEGCCONTROLLER_H
#define _SI_DEVICEGCCONTROLLER_H
#include "../PluginManager.h"
#include "SI_Device.h"
#include "GCPadStatus.h"

View File

@ -61,7 +61,6 @@ IPC_HLE_PERIOD: For the Wiimote this is the call schedule:
#include "Atomic.h"
#include "../PatchEngine.h"
#include "SystemTimers.h"
#include "../PluginManager.h"
#include "../HW/DSP.h"
#include "../HW/AudioInterface.h"
#include "../HW/VideoInterface.h"
@ -74,7 +73,7 @@ IPC_HLE_PERIOD: For the Wiimote this is the call schedule:
#include "../PluginDSP.h"
#include "Thread.h"
#include "Timer.h"
#include "VideoBackendBase.h"
namespace SystemTimers
@ -228,7 +227,7 @@ u64 GetFakeTimeBase()
// For DC watchdog hack
void FakeGPWatchdogCallback(u64 userdata, int cyclesLate)
{
CPluginManager::GetInstance().GetVideo()->Video_WaitForFrameFinish(); // lock CPUThread until frame finish
g_video_backend->Video_WaitForFrameFinish(); // lock CPUThread until frame finish
CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerFrame() - cyclesLate, et_FakeGPWD);
}

View File

@ -23,11 +23,12 @@
#include "ProcessorInterface.h"
#include "VideoInterface.h"
#include "Memmap.h"
#include "../PluginManager.h"
#include "../CoreTiming.h"
#include "../HW/SystemTimers.h"
#include "StringUtil.h"
#include "VideoBackendBase.h"
namespace VideoInterface
{
@ -783,19 +784,14 @@ static void BeginField(FieldType field)
fieldTypeNames[field]
);
Common::PluginVideo* video = CPluginManager::GetInstance().GetVideo();
if (xfbAddr && video->IsValid())
video->Video_BeginField(xfbAddr, field, fbWidth, fbHeight);
if (xfbAddr)
g_video_backend->Video_BeginField(xfbAddr, field, fbWidth, fbHeight);
}
static void EndField()
{
Common::PluginVideo* video = CPluginManager::GetInstance().GetVideo();
if (video->IsValid())
{
video->Video_EndField();
Core::VideoThrottle();
}
g_video_backend->Video_EndField();
Core::VideoThrottle();
}
// Purpose: Send VI interrupt when triggered

View File

@ -20,7 +20,6 @@
#include "WII_IPC_HLE_WiiMote.h" // Core
#include "WII_IPC_HLE_Device_usb.h"
#include "../PluginManager.h"
#include "../ConfigManager.h"
#include "../Host.h"
#include "../Core.h"

View File

@ -27,13 +27,13 @@
#include "Core.h"
#include "State.h"
#include "ConfigManager.h"
#include "PluginManager.h"
#include "HW/DSP.h"
#include "HW/Memmap.h"
#include "Host.h"
#include "PowerPC/PowerPC.h"
#include "CoreTiming.h"
#include "PluginDSP.h"
#include "VideoBackendBase.h"
extern "C" {
#include "lua.h"
@ -1375,14 +1375,14 @@ DEFINE_LUA_FUNCTION(emulua_frameadvance, "")
// run 1 frame
if(info.speedMode == SPEEDMODE_MAXIMUM)
CPluginManager::GetInstance().GetVideo()->Video_SetRendering(false);
g_video_backend->Video_SetRendering(false);
if(Core::GetState() == Core::CORE_PAUSE)
Core::SetState(Core::CORE_RUN);
PowerPC::RunLoop();
// continue as normal
if(info.speedMode == SPEEDMODE_MAXIMUM)
CPluginManager::GetInstance().GetVideo()->Video_SetRendering(true);
g_video_backend->Video_SetRendering(true);
Frame::SetFrameStopping(false);
*PowerPC::GetStatePtr() = PowerPC::CPU_RUNNING;

View File

@ -18,11 +18,11 @@
#include "OnFrame.h"
#include "Core.h"
#include "PluginManager.h"
#include "Thread.h"
#include "FileUtil.h"
#include "PowerPC/PowerPC.h"
#include "HW/SI.h"
#include "VideoBackendBase.h"
Common::CriticalSection cs_frameSkip;
@ -77,7 +77,7 @@ void SetFrameSkipping(unsigned int framesToSkip)
// Don't forget to re-enable rendering in case it wasn't...
// as this won't be changed anymore when frameskip is turned off
if (framesToSkip == 0)
CPluginManager::GetInstance().GetVideo()->Video_SetRendering(true);
g_video_backend->Video_SetRendering(true);
cs_frameSkip.Leave();
}
@ -110,7 +110,7 @@ void FrameSkipping()
if (g_frameSkipCounter > g_framesToSkip || Core::report_slow(g_frameSkipCounter) == false)
g_frameSkipCounter = 0;
CPluginManager::GetInstance().GetVideo()->Video_SetRendering(!g_frameSkipCounter);
g_video_backend->Video_SetRendering(!g_frameSkipCounter);
cs_frameSkip.Leave();
}

View File

@ -19,6 +19,7 @@
#define _PLUGINDSP_H_
#include "PluginSpecs.h" // TODO: Only here for EmuStateChange
#include "ChunkFile.h"
class PluginDSP

View File

@ -1,295 +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/
// File description
/* ------------
This file controls when plugins are loaded and unloaded from memory. Its functions scan for valid
plugins when Dolphin is booted, and open the debugging and config windows. The PluginManager is
created once when Dolphin starts and is closed when Dolphin is closed.
*/
// Include
// ------------
#include <string> // System
#include <vector>
#include "Common.h"
#include "CommonPaths.h"
#include "PluginManager.h"
#include "ConfigManager.h"
#include "LogManager.h"
#include "Core.h"
#include "Host.h"
#include "FileSearch.h" // Common
#include "FileUtil.h"
#include "StringUtil.h"
#include "MemoryUtil.h"
#include "Setup.h"
// Create the plugin manager class
CPluginManager* CPluginManager::m_Instance;
// The Plugin Manager Class
// ------------
void CPluginManager::Init()
{
m_Instance = new CPluginManager;
}
void CPluginManager::Shutdown()
{
delete m_Instance;
m_Instance = NULL;
}
// The plugin manager is some sort of singleton that runs during Dolphin's entire lifespan.
CPluginManager::CPluginManager()
{
m_PluginGlobals = new PLUGIN_GLOBALS;
// Start LogManager
m_PluginGlobals->logManager = LogManager::GetInstance();
m_params = &(SConfig::GetInstance().m_LocalCoreStartupParameter);
// Set initial values to NULL.
m_video = NULL;
}
// This will call FreeLibrary() for all plugins
CPluginManager::~CPluginManager()
{
INFO_LOG(CONSOLE, "Delete CPluginManager\n");
delete m_PluginGlobals;
delete m_video;
}
// Init and Shutdown Plugins
// ------------
// Function: Point the m_pad[] and other variables to a certain plugin
bool CPluginManager::InitPlugins()
{
// Update pluginglobals.
if (SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.size() == 0)
{
PanicAlertT("Bad gameini filename");
}
strcpy(m_PluginGlobals->game_ini, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
strcpy(m_PluginGlobals->unique_id, SConfig::GetInstance().m_LocalCoreStartupParameter.GetUniqueID().c_str());
INFO_LOG(CONSOLE, "Before GetVideo\n");
if (!GetVideo()) {
PanicAlertT("Can't init Video Plugin");
return false;
}
INFO_LOG(CONSOLE, "After GetVideo\n");
return true;
}
void CPluginManager::ShutdownVideoPlugin()
{
if (m_video)
{
m_video->Shutdown();
FreeVideo();
NOTICE_LOG(CONSOLE, "%s", Core::StopMessage(false, "Video shutdown").c_str());
}
}
// The PluginInfo class: Find Valid Plugins
// ------------
/* Function: This info is used in ScanForPlugins() to check for valid plugins and and in LoadPlugin() to
check that the filename we want to use is a good DLL. */
CPluginInfo::CPluginInfo(const char *_rFilename)
: m_Filename(_rFilename)
, m_Valid(false)
{
// Check if the functions that are common to all plugins are present
Common::CPlugin *plugin = new Common::CPlugin(_rFilename);
if (plugin->IsValid())
{
if (plugin->GetInfo(m_PluginInfo))
m_Valid = true;
else
PanicAlertT("Could not get info about plugin %s", _rFilename);
// We are now done with this plugin and will call FreeLibrary()
delete plugin;
}
else
{
WARN_LOG(CONSOLE, "PluginInfo: %s is not a valid Dolphin plugin. Ignoring.", _rFilename);
}
}
// Supporting functions
// ------------
/* Return the plugin info we saved when Dolphin was started. We don't even add a function to try load a
plugin name that was not found because in that case it must have been deleted while Dolphin was running.
If the user has done that he will instead get the "Can't open %s, it's missing" message. */
void CPluginManager::GetPluginInfo(CPluginInfo *&info, std::string Filename)
{
for (int i = 0; i < (int)m_PluginInfos.size(); i++)
{
if (m_PluginInfos.at(i).GetFilename() == Filename)
{
info = &m_PluginInfos.at(i);
return;
}
}
}
/* Called from: Get__() functions in this file only (not from anywhere else),
therefore we can leave all condition checks in the Get__() functions
below. */
void *CPluginManager::LoadPlugin(const char *_rFilename)
{
Common::CPlugin *plugin = new Common::PluginVideo(_rFilename);
// Check that the plugin has all the common and all the type specific functions
if (!plugin->IsValid())
{
PanicAlertT("Can't open %s, it has a missing function", _rFilename);
delete plugin;
return NULL;
}
// Call the DLL function SetGlobals
plugin->SetGlobals(m_PluginGlobals);
return plugin;
}
PLUGIN_GLOBALS* CPluginManager::GetGlobals()
{
return m_PluginGlobals;
}
// ----------------------------------------
// Create list of available plugins
// -------------
void CPluginManager::ScanForPlugins()
{
m_PluginInfos.clear();
// Get plugins dir
CFileSearch::XStringVector Directories;
Directories.push_back(File::GetPluginsDirectory());
CFileSearch::XStringVector Extensions;
Extensions.push_back("*" PLUGIN_SUFFIX);
// Get all DLL files in the plugins dir
CFileSearch FileSearch(Extensions, Directories);
const CFileSearch::XStringVector& rFilenames = FileSearch.GetFileNames();
if (rFilenames.size() > 0)
{
for (size_t i = 0; i < rFilenames.size(); i++)
{
std::string orig_name = rFilenames[i];
std::string Filename, Extension;
if (!SplitPath(rFilenames[i], NULL, &Filename, &Extension)) {
printf("Bad Path %s\n", rFilenames[i].c_str());
return;
}
// Leave off the directory component
std::string StoredName = Filename;
StoredName += Extension;
CPluginInfo PluginInfo(StoredName.c_str());
if (PluginInfo.IsValid())
{
// Save the Plugin
m_PluginInfos.push_back(PluginInfo);
}
}
}
}
Common::PluginVideo *CPluginManager::GetVideo()
{
/* We don't need to check if m_video->IsValid() here, because m_video will not be set by LoadPlugin()
if it's not valid */
if (m_video != NULL)
{
return m_video;
}
// and load a new plugin
m_video = (Common::PluginVideo*)LoadPlugin(m_params->m_strVideoPlugin.c_str());
return m_video;
}
// Free plugins to completely reset all variables and potential DLLs loaded by
// the plugins in turn
void CPluginManager::FreeVideo()
{
WARN_LOG(CONSOLE, "%s", Core::StopMessage(false, "Will unload video DLL").c_str());
delete m_video;
m_video = NULL;
}
void CPluginManager::EmuStateChange(PLUGIN_EMUSTATE newState)
{
GetVideo()->EmuStateChange(newState);
}
// Call DLL functions
// ------------
// Open config window. Input: _rFilename = Plugin filename , Type = Plugin type
void CPluginManager::OpenConfig(void* _Parent, const char *_rFilename, PLUGIN_TYPE Type)
{
switch(Type)
{
case PLUGIN_TYPE_VIDEO:
if (GetVideo() != NULL)
GetVideo()->Config(_Parent);
break;
default:
PanicAlertT("Type %d config not supported in plugin %s", Type, _rFilename);
break;
}
}
// Open debugging window. Type = Video or DSP. Show = Show or hide window.
void *CPluginManager::OpenDebug(void* _Parent, const char *_rFilename, PLUGIN_TYPE Type, bool Show)
{
switch(Type)
{
case PLUGIN_TYPE_VIDEO:
return GetVideo()->Debug(_Parent, Show);
break;
default:
PanicAlert("Type %d debug not supported in plugin %s", Type, _rFilename);
return NULL;
break;
}
}

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 __PLUGIN_MANAGER_H_
#define __PLUGIN_MANAGER_H_
#include "Plugin.h"
#include "PluginVideo.h"
#include "CoreParameter.h"
class CPluginInfo
{
public:
CPluginInfo(const char *_rFileName);
bool IsValid() const {return(m_Valid);}
const PLUGIN_INFO& GetPluginInfo() const {return(m_PluginInfo);}
const std::string& GetFilename() const {return(m_Filename);}
private:
PLUGIN_INFO m_PluginInfo;
std::string m_Filename;
bool m_Valid;
};
typedef std::vector<CPluginInfo>CPluginInfos;
class CPluginManager : NonCopyable
{
public:
static CPluginManager& GetInstance() {return(*m_Instance);}
static void Init();
static void Shutdown();
Common::PluginVideo *GetVideo();
void FreeVideo();
void EmuStateChange(PLUGIN_EMUSTATE newState);
bool InitPlugins();
void ShutdownVideoPlugin();
void ScanForPlugins();
void OpenConfig(void* _Parent, const char *_rFilename, PLUGIN_TYPE Type);
void *OpenDebug(void* _Parent, const char *_rFilename, PLUGIN_TYPE Type, bool Show);
const CPluginInfos& GetPluginInfos() {return(m_PluginInfos);}
PLUGIN_GLOBALS* GetGlobals();
private:
static CPluginManager* m_Instance;
CPluginInfos m_PluginInfos;
PLUGIN_GLOBALS *m_PluginGlobals;
Common::PluginVideo *m_video;
SCoreStartupParameter * m_params;
CPluginManager();
~CPluginManager();
void GetPluginInfo(CPluginInfo *&info, std::string Filename);
void *LoadPlugin(const char *_rFilename);
};
#endif

View File

@ -30,7 +30,7 @@
#include "HW/CPU.h"
#include "PowerPC/JitCommon/JitBase.h"
#include "PluginManager.h"
#include "VideoBackendBase.h"
#include <string>
@ -88,8 +88,7 @@ void DoState(PointerWrap &p)
return;
}
// Begin with video plugin, so that it gets a chance to clear it's caches and writeback modified things to RAM
CPluginManager &pm = CPluginManager::GetInstance();
pm.GetVideo()->DoState(p.GetPPtr(), p.GetMode());
g_video_backend->DoState(p);
if (Core::g_CoreStartupParameter.bWii)
Wiimote::DoState(p.GetPPtr(), p.GetMode());

View File

@ -55,7 +55,6 @@
#include "PowerPC/JitCommon/JitBase.h"
#include "PowerPC/JitCommon/JitCache.h" // for ClearCache()
#include "PluginManager.h"
#include "ConfigManager.h"
extern "C" // Bitmaps

View File

@ -58,7 +58,6 @@
#include "PowerPC/JitCommon/JitBase.h"
#include "PowerPC/JitCommon/JitCache.h" // for ClearCache()
#include "PluginManager.h"
#include "ConfigManager.h"
extern "C" // Bitmaps
@ -542,15 +541,11 @@ void CCodeWindow::ToggleSoundWindow(bool bShow)
void CCodeWindow::ToggleDLLWindow(int Id, bool bShow)
{
std::string DLLName;
int PluginType;
//int PluginType;
wxPanel *Win;
switch(Id)
{
case IDM_VIDEOWINDOW:
DLLName = SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str();
PluginType = PLUGIN_TYPE_VIDEO;
break;
default:
PanicAlert("CCodeWindow::ToggleDLLWindow called with invalid Id");
return;
@ -559,26 +554,26 @@ void CCodeWindow::ToggleDLLWindow(int Id, bool bShow)
if (bShow)
{
// Show window
Win = (wxPanel *)CPluginManager::GetInstance().OpenDebug(Parent,
DLLName.c_str(), (PLUGIN_TYPE)PluginType, bShow);
//Win = (wxPanel *)CPluginManager::GetInstance().OpenDebug(Parent,
// DLLName.c_str(), (PLUGIN_TYPE)PluginType, bShow);
if (Win)
{
Win->Show();
Win->SetId(Id);
Parent->DoAddPage(Win,
iNbAffiliation[Id - IDM_LOGWINDOW],
Parent->bFloatWindow[Id - IDM_LOGWINDOW]);
}
//if (Win)
//{
// Win->Show();
// Win->SetId(Id);
// Parent->DoAddPage(Win,
// iNbAffiliation[Id - IDM_LOGWINDOW],
// Parent->bFloatWindow[Id - IDM_LOGWINDOW]);
//}
}
else
{
Win = (wxPanel *)FindWindowById(Id);
if (Win)
{
Parent->DoRemovePage(Win, false);
Win->Destroy();
}
//Win = (wxPanel *)FindWindowById(Id);
//if (Win)
//{
// Parent->DoRemovePage(Win, false);
// Win->Destroy();
//}
}
GetMenuBar()->FindItem(Id)->Check(bShow && !!Win);
}

View File

@ -131,7 +131,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\Common\Src;..\Core\Src;..\DebuggerWX\Src;..\DebuggerUICommon\Src;..\InputCommon\Src;..\DiscIO\Src;..\..\PluginSpecs;..\..\..\Externals\SFML\include;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\Common\Src;..\AudioCommon\Src;..\Core\Src;..\DebuggerWX\Src;..\DebuggerUICommon\Src;..\InputCommon\Src;..\DiscIO\Src;..\..\PluginSpecs;..\..\..\Externals\SFML\include;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
@ -157,7 +157,7 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\Common\Src;..\Core\Src;..\DebuggerWX\Src;..\DebuggerUICommon\Src;..\InputCommon\Src;..\DiscIO\Src;..\..\PluginSpecs;..\..\..\Externals\SFML\include;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\Common\Src;..\AudioCommon\Src;..\Core\Src;..\DebuggerWX\Src;..\DebuggerUICommon\Src;..\InputCommon\Src;..\DiscIO\Src;..\..\PluginSpecs;..\..\..\Externals\SFML\include;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
@ -185,7 +185,7 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\Common\Src;..\Core\Src;..\DebuggerWX\Src;..\DebuggerUICommon\Src;..\InputCommon\Src;..\DiscIO\Src;..\..\PluginSpecs;..\..\..\Externals\SFML\include;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\Common\Src;..\AudioCommon\Src;..\Core\Src;..\DebuggerWX\Src;..\DebuggerUICommon\Src;..\InputCommon\Src;..\DiscIO\Src;..\..\PluginSpecs;..\..\..\Externals\SFML\include;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
@ -215,7 +215,7 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\Common\Src;..\Core\Src;..\DebuggerWX\Src;..\DebuggerUICommon\Src;..\InputCommon\Src;..\InputUICommon\Src;..\DiscIO\Src;..\..\PluginSpecs;..\..\..\Externals\SFML\include;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\Common\Src;..\AudioCommon\Src;..\Core\Src;..\DebuggerWX\Src;..\DebuggerUICommon\Src;..\InputCommon\Src;..\InputUICommon\Src;..\DiscIO\Src;..\..\PluginSpecs;..\..\..\Externals\SFML\include;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DEBUGFAST;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
@ -245,7 +245,7 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\Common\Src;..\Core\Src;..\DebuggerWX\Src;..\DebuggerUICommon\Src;..\InputCommon\Src;..\DiscIO\Src;..\..\PluginSpecs;..\..\..\Externals\SFML\include;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\Common\Src;..\AudioCommon\Src;..\Core\Src;..\DebuggerWX\Src;..\DebuggerUICommon\Src;..\InputCommon\Src;..\DiscIO\Src;..\..\PluginSpecs;..\..\..\Externals\SFML\include;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
@ -275,7 +275,7 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\Common\Src;..\Core\Src;..\DebuggerWX\Src;..\DebuggerUICommon\Src;..\InputCommon\Src;..\InputUICommon\Src;..\DiscIO\Src;..\..\PluginSpecs;..\..\..\Externals\SFML\include;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\Common\Src;..\AudioCommon\Src;..\Core\Src;..\DebuggerWX\Src;..\DebuggerUICommon\Src;..\InputCommon\Src;..\InputUICommon\Src;..\DiscIO\Src;..\..\PluginSpecs;..\..\..\Externals\SFML\include;..\..\..\Externals\wxWidgets\include;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DEBUGFAST;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
@ -409,6 +409,18 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
<ProjectReference Include="..\..\..\Externals\zlib\zlib.vcxproj">
<Project>{3e1339f5-9311-4122-9442-369702e8fcad}</Project>
</ProjectReference>
<ProjectReference Include="..\..\Plugins\Plugin_VideoDX11\Plugin_VideoDX11.vcxproj">
<Project>{9a4c733c-bade-4ac6-b58a-6e274395e90e}</Project>
</ProjectReference>
<ProjectReference Include="..\..\Plugins\Plugin_VideoDX9\Plugin_VideoDX9.vcxproj">
<Project>{dc7d7af4-ce47-49e8-8b63-265cb6233a49}</Project>
</ProjectReference>
<ProjectReference Include="..\..\Plugins\Plugin_VideoOGL\Plugin_VideoOGL.vcxproj">
<Project>{1909cd2d-1707-456f-86ca-0df42a727c99}</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>
@ -424,9 +436,18 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
<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="..\InputCommon\InputCommon.vcxproj">
<Project>{b39ac394-5db5-4da9-9d98-09d46ca3701f}</Project>
</ProjectReference>
<ProjectReference Include="..\VideoCommon\VideoCommon.vcxproj">
<Project>{3e5c4e02-1ba9-4776-bdbe-e3f91ffa34cf}</Project>
</ProjectReference>
<ProjectReference Include="..\VideoUICommon\VideoUICommon.vcxproj">
<Project>{281f6001-d032-4c3b-87af-0b00962b4006}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="DolphinWX.rc" />
@ -434,4 +455,4 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -30,13 +30,14 @@
#include "Globals.h" // Local
#include "ConfigMain.h"
#include "PluginManager.h"
#include "ConfigManager.h"
#include "SysConf.h"
#include "Frame.h"
#include "HotkeyDlg.h"
#include "Main.h"
#include "VideoBackendBase.h"
#ifdef __APPLE__
#include <ApplicationServices/ApplicationServices.h>
#endif
@ -176,8 +177,7 @@ EVT_BUTTON(ID_GRAPHIC_CONFIG, CConfigMain::OnConfig)
END_EVENT_TABLE()
CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title,
const wxPoint& position, const wxSize& size, long style)
CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style)
: wxDialog(parent, id, title, position, size, style)
{
// Control refreshing of the ISOs list
@ -223,6 +223,7 @@ void CConfigMain::UpdateGUI()
CPUEngine->Disable();
LockThreads->Disable();
DSPThread->Disable();
// Disable stuff on DisplayPage
FullscreenResolution->Disable();
@ -230,16 +231,12 @@ void CConfigMain::UpdateGUI()
ProgressiveScan->Disable();
NTSCJ->Disable();
#if defined _WIN32 || defined __linux__
// Disable graphics plugin selection
GraphicSelection->Disable();
#endif
// Disable stuff on AudioPage
DSPEngine->Disable();
// Disable stuff on GamecubePage
GCSystemLang->Disable();
// Disable stuff on WiiPage
WiiSensBarPos->Disable();
@ -250,8 +247,15 @@ void CConfigMain::UpdateGUI()
WiiAspectRatio->Disable();
WiiSystemLang->Disable();
// Disable stuff on PathsPage
PathsPage->Disable();
#if defined _WIN32 || defined __linux__
// Disable stuff on PluginsPage
GraphicSelection->Disable();
#endif
}
}
@ -376,8 +380,7 @@ void CConfigMain::InitializeGUIValues()
UsePanicHandlers->SetValue(startup_params.bUsePanicHandlers);
Theme->SetSelection(startup_params.iTheme);
// need redesign
for (unsigned int i = 0; i < sizeof(langIds) / sizeof(wxLanguage); i++)
{
for (unsigned int i = 0; i < sizeof(langIds) / sizeof(wxLanguage); i++) {
if (langIds[i] == SConfig::GetInstance().m_InterfaceLanguage)
{
InterfaceLang->SetSelection(i);
@ -407,90 +410,9 @@ void CConfigMain::InitializeGUIValues()
GCSystemLang->SetSelection(startup_params.SelectedLanguage);
// Gamecube - Devices
wxArrayString SlotDevices;
SlotDevices.Add(_(DEV_NONE_STR));
SlotDevices.Add(_(DEV_DUMMY_STR));
SlotDevices.Add(_(EXIDEV_MEMCARD_STR));
SlotDevices.Add(_(EXIDEV_GECKO_STR));
#if HAVE_PORTAUDIO
SlotDevices.Add(_(EXIDEV_MIC_STR));
#endif
// Not here. They use some locals over in CreateGUIControls for initialization,
// which is why they are still there.
wxArrayString SP1Devices;
SP1Devices.Add(_(DEV_NONE_STR));
SP1Devices.Add(_(DEV_DUMMY_STR));
SP1Devices.Add(_(EXIDEV_BBA_STR));
SP1Devices.Add(_(EXIDEV_AM_BB_STR));
wxArrayString SIDevices;
SIDevices.Add(_(DEV_NONE_STR));
SIDevices.Add(_(SIDEV_STDCONT_STR));
SIDevices.Add(_(SIDEV_GBA_STR));
SIDevices.Add(_(SIDEV_AM_BB_STR));
for (int i = 0; i < 3; ++i)
{
bool isMemcard = false;
// Add strings to the wxChoice list, the third wxChoice is the SP1 slot
if (i == 2)
GCEXIDevice[i]->Append(SP1Devices);
else
GCEXIDevice[i]->Append(SlotDevices);
switch (SConfig::GetInstance().m_EXIDevice[i])
{
case EXIDEVICE_NONE:
GCEXIDevice[i]->SetStringSelection(SlotDevices[0]);
break;
case EXIDEVICE_MEMORYCARD_A:
case EXIDEVICE_MEMORYCARD_B:
isMemcard = GCEXIDevice[i]->SetStringSelection(SlotDevices[2]);
break;
case EXIDEVICE_MIC:
GCEXIDevice[i]->SetStringSelection(SlotDevices[4]);
break;
case EXIDEVICE_ETH:
GCEXIDevice[i]->SetStringSelection(SP1Devices[2]);
break;
case EXIDEVICE_AM_BASEBOARD:
GCEXIDevice[i]->SetStringSelection(SP1Devices[3]);
break;
case EXIDEVICE_GECKO:
GCEXIDevice[i]->SetStringSelection(SlotDevices[3]);
break;
case EXIDEVICE_DUMMY:
default:
GCEXIDevice[i]->SetStringSelection(SlotDevices[1]);
break;
}
if (!isMemcard && i < 2)
GCMemcardPath[i]->Disable();
}
for (int i = 0; i < 4; ++i)
{
// Add string to the wxChoice list
GCSIDevice[i]->Append(SIDevices);
switch (SConfig::GetInstance().m_SIDevice[i])
{
case SI_GC_CONTROLLER:
GCSIDevice[i]->SetStringSelection(SIDevices[1]);
break;
case SI_GBA:
GCSIDevice[i]->SetStringSelection(SIDevices[2]);
break;
case SI_AM_BASEBOARD:
GCSIDevice[i]->SetStringSelection(SIDevices[3]);
break;
default:
GCSIDevice[i]->SetStringSelection(SIDevices[0]);
break;
}
// Remove the AM baseboard from the list, only the first list can select it
if (i == 0)
SIDevices.RemoveAt(SIDevices.GetCount() - 1);
}
// Wii - Wiimote
WiiSensBarPos->SetSelection(SConfig::GetInstance().m_SYSCONF->GetData<u8>("BT.BAR"));
@ -514,11 +436,13 @@ void CConfigMain::InitializeGUIValues()
DVDRoot->SetPath(wxString(startup_params.m_strDVDRoot.c_str(), *wxConvCurrent));
ApploaderPath->SetPath(wxString(startup_params.m_strApploader.c_str(), *wxConvCurrent));
#if defined _WIN32 || defined __linux__
// Plugins
FillChoiceBox(GraphicSelection, PLUGIN_TYPE_VIDEO, startup_params.m_strVideoPlugin);
#endif
// video backend list
for (std::vector<VideoBackend*>::const_iterator it = g_available_video_backends.begin(); it != g_available_video_backends.end(); ++it)
{
GraphicSelection->AppendString(wxString::FromUTF8((*it)->GetName().c_str()));
if (*it == g_video_backend)
GraphicSelection->Select(it - g_available_video_backends.begin());
}
}
void CConfigMain::InitializeGUITooltips()
@ -556,6 +480,7 @@ void CConfigMain::InitializeGUITooltips()
// Audio tooltips
EnableDTKMusic->SetToolTip(_("This is used to play music tracks, like BGM."));
EnableThrottle->SetToolTip(_("This is used to control game speed by sound throttle.\nDisabling this could cause abnormal game speed, such as too fast.\nBut sometimes enabling this could cause constant noise.\n\nKeyboard Shortcut <TAB>: Hold down to instantly disable Throttle."));
DSPEngine->SetToolTip(_("please someone fill this tooltip i have no idea what to say :D"));
FrequencySelection->SetToolTip(_("Changing this will have no effect while the emulator is running!"));
BackendSelection->SetToolTip(_("Changing this will have no effect while the emulator is running!"));
@ -571,13 +496,13 @@ void CConfigMain::CreateGUIControls()
InitializeGUILists();
// Create the notebook and pages
Notebook = new wxNotebook(this, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize);
wxPanel *GeneralPage = new wxPanel(Notebook, ID_GENERALPAGE, wxDefaultPosition, wxDefaultSize);
wxPanel *DisplayPage = new wxPanel(Notebook, ID_DISPLAYPAGE, wxDefaultPosition, wxDefaultSize);
wxPanel *AudioPage = new wxPanel(Notebook, ID_AUDIOPAGE, wxDefaultPosition, wxDefaultSize);
wxPanel *GamecubePage = new wxPanel(Notebook, ID_GAMECUBEPAGE, wxDefaultPosition, wxDefaultSize);
wxPanel *WiiPage = new wxPanel(Notebook, ID_WIIPAGE, wxDefaultPosition, wxDefaultSize);
PathsPage = new wxPanel(Notebook, ID_PATHSPAGE, wxDefaultPosition, wxDefaultSize);
wxNotebook* const Notebook = new wxNotebook(this, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize);
wxPanel* const GeneralPage = new wxPanel(Notebook, ID_GENERALPAGE, wxDefaultPosition, wxDefaultSize);
wxPanel* const DisplayPage = new wxPanel(Notebook, ID_DISPLAYPAGE, wxDefaultPosition, wxDefaultSize);
wxPanel* const AudioPage = new wxPanel(Notebook, ID_AUDIOPAGE, wxDefaultPosition, wxDefaultSize);
wxPanel* const GamecubePage = new wxPanel(Notebook, ID_GAMECUBEPAGE, wxDefaultPosition, wxDefaultSize);
wxPanel* const WiiPage = new wxPanel(Notebook, ID_WIIPAGE, wxDefaultPosition, wxDefaultSize);
wxPanel* const PathsPage = new wxPanel(Notebook, ID_PATHSPAGE, wxDefaultPosition, wxDefaultSize);
Notebook->AddPage(GeneralPage, _("General"));
Notebook->AddPage(DisplayPage, _("Display"));
@ -588,30 +513,19 @@ void CConfigMain::CreateGUIControls()
// General page
// Core Settings - Basic
wxStaticBoxSizer *sbBasic =
new wxStaticBoxSizer(wxVERTICAL, GeneralPage, _("Basic Settings"));
CPUThread = new wxCheckBox(GeneralPage, ID_CPUTHREAD, _("Enable Dual Core (speedup)"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
SkipIdle = new wxCheckBox(GeneralPage, ID_IDLESKIP, _("Enable Idle Skipping (speedup)"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
EnableCheats = new wxCheckBox(GeneralPage, ID_ENABLECHEATS, _("Enable Cheats"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
wxStaticBoxSizer* const sbBasic = new wxStaticBoxSizer(wxVERTICAL, GeneralPage, _("Basic Settings"));
CPUThread = new wxCheckBox(GeneralPage, ID_CPUTHREAD, _("Enable Dual Core (speedup)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
SkipIdle = new wxCheckBox(GeneralPage, ID_IDLESKIP, _("Enable Idle Skipping (speedup)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
EnableCheats = new wxCheckBox(GeneralPage, ID_ENABLECHEATS, _("Enable Cheats"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
// Framelimit
Framelimit = new wxChoice(GeneralPage, ID_FRAMELIMIT, wxDefaultPosition, wxDefaultSize,
arrayStringFor_Framelimit, 0, wxDefaultValidator);
UseFPSForLimiting = new wxCheckBox(GeneralPage, ID_FRAMELIMIT_USEFPSFORLIMITING,
_("Use FPS For Limiting"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
Framelimit = new wxChoice(GeneralPage, ID_FRAMELIMIT, wxDefaultPosition, wxDefaultSize, arrayStringFor_Framelimit, 0, wxDefaultValidator);
UseFPSForLimiting = new wxCheckBox(GeneralPage, ID_FRAMELIMIT_USEFPSFORLIMITING, _("Use FPS For Limiting"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
// Core Settings - Advanced
wxStaticBoxSizer *sbAdvanced =
new wxStaticBoxSizer(wxVERTICAL, GeneralPage, _("Advanced Settings"));
AlwaysHLE_BS2 = new wxCheckBox(GeneralPage, ID_ALWAYS_HLE_BS2, _("Skip GC BIOS"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
CPUEngine = new wxRadioBox(GeneralPage, ID_CPUENGINE, _("CPU Emulator Engine"),
wxDefaultPosition, wxDefaultSize, arrayStringFor_CPUEngine, 0, wxRA_SPECIFY_ROWS);
LockThreads = new wxCheckBox(GeneralPage, ID_LOCKTHREADS, _("Lock threads to cores"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
DSPThread = new wxCheckBox(GeneralPage, ID_DSPTHREAD, _("DSPLLE on thread"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
wxStaticBoxSizer* const sbAdvanced = new wxStaticBoxSizer(wxVERTICAL, GeneralPage, _("Advanced Settings"));
AlwaysHLE_BS2 = new wxCheckBox(GeneralPage, ID_ALWAYS_HLE_BS2, _("Skip GC BIOS"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
CPUEngine = new wxRadioBox(GeneralPage, ID_CPUENGINE, _("CPU Emulator Engine"), wxDefaultPosition, wxDefaultSize, arrayStringFor_CPUEngine, 0, wxRA_SPECIFY_ROWS);
LockThreads = new wxCheckBox(GeneralPage, ID_LOCKTHREADS, _("Lock threads to cores"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
DSPThread = new wxCheckBox(GeneralPage, ID_DSPTHREAD, _("DSPLLE on thread"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
// Populate the General settings
sbBasic->Add(CPUThread, 0, wxALL, 5);
@ -628,73 +542,57 @@ void CConfigMain::CreateGUIControls()
sbAdvanced->Add(LockThreads, 0, wxALL, 5);
sbAdvanced->Add(DSPThread, 0, wxALL, 5);
wxBoxSizer *sGeneralPage = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* const sGeneralPage = new wxBoxSizer(wxVERTICAL);
sGeneralPage->Add(sbBasic, 0, wxEXPAND | wxALL, 5);
sGeneralPage->Add(sbAdvanced, 0, wxEXPAND | wxALL, 5);
GeneralPage->SetSizer(sGeneralPage);
// General display settings
sbDisplay = new wxStaticBoxSizer(wxVERTICAL, DisplayPage, _("Emulator Display Settings"));
FullscreenResolution = new wxChoice(DisplayPage, ID_DISPLAY_FULLSCREENRES,
wxDefaultPosition, wxDefaultSize, arrayStringFor_FullscreenResolution,
0, wxDefaultValidator, arrayStringFor_FullscreenResolution[0]);
WindowWidth = new wxSpinCtrl(DisplayPage, ID_DISPLAY_WINDOWWIDTH, wxEmptyString,
wxDefaultPosition, wxSize(70, -1));
FullscreenResolution = new wxChoice(DisplayPage, ID_DISPLAY_FULLSCREENRES, wxDefaultPosition, wxDefaultSize, arrayStringFor_FullscreenResolution, 0, wxDefaultValidator, arrayStringFor_FullscreenResolution[0]);
WindowWidth = new wxSpinCtrl(DisplayPage, ID_DISPLAY_WINDOWWIDTH, wxEmptyString, wxDefaultPosition, wxSize(70, -1));
WindowWidth->SetRange(0,3280);
WindowHeight = new wxSpinCtrl(DisplayPage, ID_DISPLAY_WINDOWHEIGHT,
wxEmptyString, wxDefaultPosition, wxSize(70, -1));
WindowHeight = new wxSpinCtrl(DisplayPage, ID_DISPLAY_WINDOWHEIGHT, wxEmptyString, wxDefaultPosition, wxSize(70, -1));
WindowHeight->SetRange(0,2048);
WindowAutoSize = new wxCheckBox(DisplayPage, ID_DISPLAY_AUTOSIZE, _("Auto"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
Fullscreen = new wxCheckBox(DisplayPage, ID_DISPLAY_FULLSCREEN,
_("Start Renderer in Fullscreen"), wxDefaultPosition, wxDefaultSize,
0, wxDefaultValidator);
WindowAutoSize = new wxCheckBox(DisplayPage, ID_DISPLAY_AUTOSIZE, _("Auto"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
Fullscreen = new wxCheckBox(DisplayPage, ID_DISPLAY_FULLSCREEN, _("Start Renderer in Fullscreen"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
HideCursor = new wxCheckBox(DisplayPage, ID_DISPLAY_HIDECURSOR, _("Hide Mouse Cursor"));
RenderToMain = new wxCheckBox(DisplayPage, ID_DISPLAY_RENDERTOMAIN,
_("Render to Main Window"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
ProgressiveScan = new wxCheckBox(DisplayPage, ID_DISPLAY_PROGSCAN,
_("Enable Progressive Scan"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
NTSCJ = new wxCheckBox(DisplayPage, ID_DISPLAY_NTSCJ, _("Set Console as NTSC-J"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
#if defined _WIN32 || defined __linux__
// GFX Plugin Selection
GraphicSelection = new wxChoice(DisplayPage, ID_GRAPHIC_CB,
wxDefaultPosition, wxDefaultSize, 0, NULL, 0, wxDefaultValidator);
GraphicConfig = new wxButton(DisplayPage, ID_GRAPHIC_CONFIG, _("Config..."),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
#endif
RenderToMain = new wxCheckBox(DisplayPage, ID_DISPLAY_RENDERTOMAIN, _("Render to Main Window"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
ProgressiveScan = new wxCheckBox(DisplayPage, ID_DISPLAY_PROGSCAN, _("Enable Progressive Scan"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
NTSCJ = new wxCheckBox(DisplayPage, ID_DISPLAY_NTSCJ, _("Set Console as NTSC-J"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
// Interface Language
// TODO : Do these really belong to the display page?
InterfaceLang = new wxChoice(DisplayPage, ID_INTERFACE_LANG, wxDefaultPosition,
wxDefaultSize, arrayStringFor_InterfaceLang, 0, wxDefaultValidator);
InterfaceLang = new wxChoice(DisplayPage, ID_INTERFACE_LANG, wxDefaultPosition, wxDefaultSize, arrayStringFor_InterfaceLang, 0, wxDefaultValidator);
// Hotkey configuration
HotkeyConfig = new wxButton(DisplayPage, ID_HOTKEY_CONFIG, _("Hotkeys"),
wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT, wxDefaultValidator);
// TODO : doesn't really belong to the display page, heh.
HotkeyConfig = new wxButton(DisplayPage, ID_HOTKEY_CONFIG, _("Hotkeys"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT, wxDefaultValidator);
// Themes - this should really be a wxChoice...
Theme = new wxRadioBox(DisplayPage, ID_INTERFACE_THEME, _("Theme"),
wxDefaultPosition, wxDefaultSize, arrayStringFor_Themes, 1, wxRA_SPECIFY_ROWS);
Theme = new wxRadioBox(DisplayPage, ID_INTERFACE_THEME, _("Theme"), wxDefaultPosition, wxDefaultSize, arrayStringFor_Themes, 1, wxRA_SPECIFY_ROWS);
// Interface settings
sbInterface = new wxStaticBoxSizer(wxVERTICAL, DisplayPage, _("Interface Settings"));
ConfirmStop = new wxCheckBox(DisplayPage, ID_INTERFACE_CONFIRMSTOP, _("Confirm On Stop"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
UsePanicHandlers = new wxCheckBox(DisplayPage, ID_INTERFACE_USEPANICHANDLERS,
_("Use Panic Handlers"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
ConfirmStop = new wxCheckBox(DisplayPage, ID_INTERFACE_CONFIRMSTOP, _("Confirm On Stop"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
UsePanicHandlers = new wxCheckBox(DisplayPage, ID_INTERFACE_USEPANICHANDLERS, _("Use Panic Handlers"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
// Populate the Display page
wxBoxSizer* sDisplayRes = new wxBoxSizer(wxHORIZONTAL);
sDisplayRes->Add(TEXT_BOX(DisplayPage, _("Fullscreen Display Resolution:")),
0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
sDisplayRes->Add(FullscreenResolution, 0, wxEXPAND | wxALL, 5);
0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
sDisplayRes->Add(FullscreenResolution, 0, wxEXPAND, 5);
sbDisplay->Add(sDisplayRes, 0, wxALL, 5);
// backend
wxBoxSizer* svidbackend = new wxBoxSizer(wxHORIZONTAL);
svidbackend->Add(TEXT_BOX(DisplayPage, _("Video Backend:")), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
GraphicSelection = new wxChoice(DisplayPage, ID_GRAPHIC_CB, wxDefaultPosition, wxDefaultSize, 0, NULL, 0, wxDefaultValidator);
svidbackend->Add(GraphicSelection, 0, wxALIGN_CENTER_VERTICAL, 5);
sbDisplay->Add(svidbackend, 0, wxLEFT, 5);
wxBoxSizer* sDisplaySize = new wxBoxSizer(wxHORIZONTAL);
sDisplaySize->Add(TEXT_BOX(DisplayPage, _("Window Size:")), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
sDisplaySize->Add(WindowWidth, 0, wxEXPAND | wxALL, 5);
sDisplaySize->Add(TEXT_BOX(DisplayPage, wxT("x")), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
sDisplaySize->Add(WindowHeight, 0, wxEXPAND | wxALL, 5);
sDisplaySize->Add(WindowAutoSize, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
sDisplaySize->Add(TEXT_BOX(DisplayPage, _("Window Size:")), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
sDisplaySize->Add(WindowWidth, 0, wxEXPAND | wxRIGHT, 5);
sDisplaySize->Add(TEXT_BOX(DisplayPage, wxT("x")), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
sDisplaySize->Add(WindowHeight, 0, wxEXPAND | wxRIGHT, 5);
sDisplaySize->Add(WindowAutoSize, 0, wxALIGN_CENTER_VERTICAL, 5);
sbDisplay->Add(sDisplaySize, 0, wxALL, 5);
sbDisplay->Add(Fullscreen, 0, wxEXPAND | wxALL, 5);
sbDisplay->Add(HideCursor, 0, wxALL, 5);
@ -702,13 +600,6 @@ void CConfigMain::CreateGUIControls()
sbDisplay->Add(ProgressiveScan, 0, wxEXPAND | wxALL, 5);
sbDisplay->Add(NTSCJ, 0, wxEXPAND | wxALL, 5);
#if defined _WIN32 || defined __linux__
wxStaticBoxSizer *sbGraphicsPlugin =
new wxStaticBoxSizer(wxHORIZONTAL, DisplayPage, _("Graphics Plugin"));
sbGraphicsPlugin->Add(GraphicSelection, 1, wxEXPAND|wxALL, 5);
sbGraphicsPlugin->Add(GraphicConfig, 0, wxALL, 5);
#endif
sbInterface->Add(ConfirmStop, 0, wxALL, 5);
sbInterface->Add(UsePanicHandlers, 0, wxALL, 5);
sbInterface->Add(Theme, 0, wxEXPAND | wxALL, 5);
@ -721,26 +612,17 @@ void CConfigMain::CreateGUIControls()
sDisplayPage = new wxBoxSizer(wxVERTICAL);
sDisplayPage->Add(sbDisplay, 0, wxEXPAND | wxALL, 5);
#if defined _WIN32 || defined __linux__
sDisplayPage->Add(sbGraphicsPlugin, 0, wxEXPAND | wxALL, 5);
#endif
sDisplayPage->Add(sbInterface, 0, wxEXPAND | wxALL, 5);
DisplayPage->SetSizer(sDisplayPage);
// Audio page
DSPEngine = new wxRadioBox(AudioPage, ID_DSPENGINE, _("DSP Emulator Engine"),
wxDefaultPosition, wxDefaultSize, arrayStringFor_DSPEngine, 0, wxRA_SPECIFY_ROWS);
EnableDTKMusic = new wxCheckBox(AudioPage, ID_ENABLE_DTK_MUSIC, _("Enable DTK Music"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
EnableThrottle = new wxCheckBox(AudioPage, ID_ENABLE_THROTTLE, _("Enable Audio Throttle"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
VolumeSlider = new wxSlider(AudioPage, ID_VOLUME, 0, 1, 100,
wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL|wxSL_INVERSE);
VolumeText = new wxStaticText(AudioPage, wxID_ANY, wxT(""),
wxDefaultPosition, wxDefaultSize, 0);
BackendSelection = new wxChoice(AudioPage, ID_BACKEND, wxDefaultPosition,
wxDefaultSize, wxArrayBackends, 0, wxDefaultValidator, wxEmptyString);
DSPEngine = new wxRadioBox(AudioPage, ID_DSPENGINE, _("DSP Emulator Engine"), wxDefaultPosition, wxDefaultSize, arrayStringFor_DSPEngine, 0, wxRA_SPECIFY_ROWS);
EnableDTKMusic = new wxCheckBox(AudioPage, ID_ENABLE_DTK_MUSIC, _("Enable DTK Music"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
EnableThrottle = new wxCheckBox(AudioPage, ID_ENABLE_THROTTLE, _("Enable Audio Throttle"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
VolumeSlider = new wxSlider(AudioPage, ID_VOLUME, 0, 1, 100, wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL|wxSL_INVERSE);
VolumeText = new wxStaticText(AudioPage, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, 0);
BackendSelection = new wxChoice(AudioPage, ID_BACKEND, wxDefaultPosition, wxDefaultSize, wxArrayBackends, 0, wxDefaultValidator, wxEmptyString);
FrequencySelection = new wxChoice(AudioPage, ID_FREQUENCY);
FrequencySelection->Append(_("48,000 Hz"));
FrequencySelection->Append(_("32,000 Hz"));
@ -775,26 +657,66 @@ void CConfigMain::CreateGUIControls()
AudioPage->SetSizerAndFit(sAudioPage);
// TODO : Warning the following code hurts
// Gamecube page
// IPL settings
sbGamecubeIPLSettings = new wxStaticBoxSizer(wxVERTICAL, GamecubePage, _("IPL Settings"));
GCSystemLang = new wxChoice(GamecubePage, ID_GC_SRAM_LNG, wxDefaultPosition,
wxDefaultSize, arrayStringFor_GCSystemLang, 0, wxDefaultValidator);
GCSystemLang = new wxChoice(GamecubePage, ID_GC_SRAM_LNG, wxDefaultPosition, wxDefaultSize, arrayStringFor_GCSystemLang, 0, wxDefaultValidator);
// Device settings
// EXI Devices
wxStaticBoxSizer *sbGamecubeDeviceSettings =
new wxStaticBoxSizer(wxVERTICAL, GamecubePage, _("Device Settings"));
wxStaticBoxSizer *sbGamecubeDeviceSettings = new wxStaticBoxSizer(wxVERTICAL, GamecubePage, _("Device Settings"));
wxStaticText* GCEXIDeviceText[3];
GCEXIDeviceText[0] = TEXT_BOX(GamecubePage, _("Slot A"));
GCEXIDeviceText[1] = TEXT_BOX(GamecubePage, _("Slot B"));
GCEXIDeviceText[2] = TEXT_BOX(GamecubePage, wxT("SP1 "));
GCEXIDevice[0] = new wxChoice(GamecubePage, ID_GC_EXIDEVICE_SLOTA);
GCEXIDevice[1] = new wxChoice(GamecubePage, ID_GC_EXIDEVICE_SLOTB);
GCEXIDevice[2] = new wxChoice(GamecubePage, ID_GC_EXIDEVICE_SP1);
GCMemcardPath[0] = new wxButton(GamecubePage, ID_GC_EXIDEVICE_SLOTA_PATH, wxT("..."),
wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT, wxDefaultValidator);
GCMemcardPath[1] = new wxButton(GamecubePage, ID_GC_EXIDEVICE_SLOTB_PATH, wxT("..."),
wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT, wxDefaultValidator);
const wxString SlotDevices[] = {_(DEV_NONE_STR), _(DEV_DUMMY_STR), _(EXIDEV_MEMCARD_STR), _(EXIDEV_GECKO_STR)
#if HAVE_PORTAUDIO
, _(EXIDEV_MIC_STR)
#endif
};
static const int numSlotDevices = sizeof(SlotDevices)/sizeof(wxString);
const wxString SP1Devices[] = { _(DEV_NONE_STR), _(DEV_DUMMY_STR), _(EXIDEV_BBA_STR), _(EXIDEV_AM_BB_STR) };
static const int numSP1Devices = sizeof(SP1Devices)/sizeof(wxString);
GCEXIDevice[0] = new wxChoice(GamecubePage, ID_GC_EXIDEVICE_SLOTA, wxDefaultPosition, wxDefaultSize, numSlotDevices, SlotDevices, 0, wxDefaultValidator);
GCEXIDevice[1] = new wxChoice(GamecubePage, ID_GC_EXIDEVICE_SLOTB, wxDefaultPosition, wxDefaultSize, numSlotDevices, SlotDevices, 0, wxDefaultValidator);
GCEXIDevice[2] = new wxChoice(GamecubePage, ID_GC_EXIDEVICE_SP1, wxDefaultPosition, wxDefaultSize, numSP1Devices, SP1Devices, 0, wxDefaultValidator);
GCMemcardPath[0] = new wxButton(GamecubePage, ID_GC_EXIDEVICE_SLOTA_PATH, wxT("..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT, wxDefaultValidator);
GCMemcardPath[1] = new wxButton(GamecubePage, ID_GC_EXIDEVICE_SLOTB_PATH, wxT("..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT, wxDefaultValidator);
// Can't move this one without making the 4 const's etc. above class members/fields,
// TODO : lies, wxArrayString + wxChoice->Create.
for (int i = 0; i < 3; ++i)
{
bool isMemcard = false;
switch (SConfig::GetInstance().m_EXIDevice[i])
{
case EXIDEVICE_NONE:
GCEXIDevice[i]->SetStringSelection(SlotDevices[0]);
break;
case EXIDEVICE_MEMORYCARD_A:
case EXIDEVICE_MEMORYCARD_B:
isMemcard = GCEXIDevice[i]->SetStringSelection(SlotDevices[2]);
break;
case EXIDEVICE_MIC:
GCEXIDevice[i]->SetStringSelection(SlotDevices[4]);
break;
case EXIDEVICE_ETH:
GCEXIDevice[i]->SetStringSelection(SP1Devices[2]);
break;
case EXIDEVICE_AM_BASEBOARD:
GCEXIDevice[i]->SetStringSelection(SP1Devices[3]);
break;
case EXIDEVICE_GECKO:
GCEXIDevice[i]->SetStringSelection(SlotDevices[3]);
break;
case EXIDEVICE_DUMMY:
default:
GCEXIDevice[i]->SetStringSelection(SlotDevices[1]);
break;
}
if (!isMemcard && i < 2)
GCMemcardPath[i]->Disable();
}
//SI Devices
wxStaticText* GCSIDeviceText[4];
@ -802,11 +724,33 @@ void CConfigMain::CreateGUIControls()
GCSIDeviceText[1] = TEXT_BOX(GamecubePage, _("Port 2"));
GCSIDeviceText[2] = TEXT_BOX(GamecubePage, _("Port 3"));
GCSIDeviceText[3] = TEXT_BOX(GamecubePage, _("Port 4"));
GCSIDevice[0] = new wxChoice(GamecubePage, ID_GC_SIDEVICE0);
GCSIDevice[1] = new wxChoice(GamecubePage, ID_GC_SIDEVICE1);
GCSIDevice[2] = new wxChoice(GamecubePage, ID_GC_SIDEVICE2);
GCSIDevice[3] = new wxChoice(GamecubePage, ID_GC_SIDEVICE3);
// SIDEV_AM_BB_STR must be last!
const wxString SIDevices[] = {_(DEV_NONE_STR),_(SIDEV_STDCONT_STR),_(SIDEV_GBA_STR),_(SIDEV_AM_BB_STR)};
static const int numSIDevices = sizeof(SIDevices)/sizeof(wxString);
GCSIDevice[0] = new wxChoice(GamecubePage, ID_GC_SIDEVICE0, wxDefaultPosition, wxDefaultSize, numSIDevices, SIDevices, 0, wxDefaultValidator);
GCSIDevice[1] = new wxChoice(GamecubePage, ID_GC_SIDEVICE1, wxDefaultPosition, wxDefaultSize, numSIDevices - 1, SIDevices, 0, wxDefaultValidator);
GCSIDevice[2] = new wxChoice(GamecubePage, ID_GC_SIDEVICE2, wxDefaultPosition, wxDefaultSize, numSIDevices - 1, SIDevices, 0, wxDefaultValidator);
GCSIDevice[3] = new wxChoice(GamecubePage, ID_GC_SIDEVICE3, wxDefaultPosition, wxDefaultSize, numSIDevices - 1, SIDevices, 0, wxDefaultValidator);
// Can't move this one without making the 2 const's etc. above class members/fields.
for (int i = 0; i < 4; ++i)
{
switch (SConfig::GetInstance().m_SIDevice[i])
{
case SI_GC_CONTROLLER:
GCSIDevice[i]->SetStringSelection(SIDevices[1]);
break;
case SI_GBA:
GCSIDevice[i]->SetStringSelection(SIDevices[2]);
break;
case SI_AM_BASEBOARD:
GCSIDevice[i]->SetStringSelection(SIDevices[3]);
break;
default:
GCSIDevice[i]->SetStringSelection(SIDevices[0]);
break;
}
}
// Populate the Gamecube page
sGamecubeIPLSettings = new wxGridBagSizer();
@ -840,30 +784,21 @@ void CConfigMain::CreateGUIControls()
// Wii page
// Wiimote Settings
sbWiimoteSettings = new wxStaticBoxSizer(wxHORIZONTAL, WiiPage, _("Wiimote Settings"));
WiiSensBarPos = new wxChoice(WiiPage, ID_WII_BT_BAR, wxDefaultPosition,
wxDefaultSize, arrayStringFor_WiiSensBarPos, 0, wxDefaultValidator);
WiiSensBarPos = new wxChoice(WiiPage, ID_WII_BT_BAR, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiSensBarPos, 0, wxDefaultValidator);
WiiSensBarSens = new wxSlider(WiiPage, ID_WII_BT_SENS, 0, 0, 4);
WiimoteMotor = new wxCheckBox(WiiPage, ID_WII_BT_MOT, _("Wiimote Motor"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiimoteMotor = new wxCheckBox(WiiPage, ID_WII_BT_MOT, _("Wiimote Motor"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
// Misc Settings
sbWiiIPLSettings = new wxStaticBoxSizer(wxVERTICAL, WiiPage, _("Misc Settings"));
WiiScreenSaver = new wxCheckBox(WiiPage, ID_WII_IPL_SSV,
_("Enable Screen Saver (burn-in reduction)"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiEuRGB60 = new wxCheckBox(WiiPage, ID_WII_IPL_E60, _("Use EuRGB60 Mode (PAL60)"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiAspectRatio = new wxChoice(WiiPage, ID_WII_IPL_AR, wxDefaultPosition,
wxDefaultSize, arrayStringFor_WiiAspectRatio, 0, wxDefaultValidator);
WiiSystemLang = new wxChoice(WiiPage, ID_WII_IPL_LNG, wxDefaultPosition,
wxDefaultSize, arrayStringFor_WiiSystemLang, 0, wxDefaultValidator);
WiiScreenSaver = new wxCheckBox(WiiPage, ID_WII_IPL_SSV, _("Enable Screen Saver (burn-in reduction)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiEuRGB60 = new wxCheckBox(WiiPage, ID_WII_IPL_E60, _("Use EuRGB60 Mode (PAL60)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiAspectRatio = new wxChoice(WiiPage, ID_WII_IPL_AR, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiAspectRatio, 0, wxDefaultValidator);
WiiSystemLang = new wxChoice(WiiPage, ID_WII_IPL_LNG, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiSystemLang, 0, wxDefaultValidator);
// Device Settings
sbWiiDeviceSettings = new wxStaticBoxSizer(wxVERTICAL, WiiPage, _("Device Settings"));
WiiSDCard = new wxCheckBox(WiiPage, ID_WII_SD_CARD, _("Insert SD Card"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiKeyboard = new wxCheckBox(WiiPage, ID_WII_KEYBOARD, _("Connect USB Keyboard"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiSDCard = new wxCheckBox(WiiPage, ID_WII_SD_CARD, _("Insert SD Card"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiKeyboard = new wxCheckBox(WiiPage, ID_WII_KEYBOARD, _("Connect USB Keyboard"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
// Populate the Wii Page
sWiimoteSettings = new wxGridBagSizer();
@ -899,27 +834,19 @@ void CConfigMain::CreateGUIControls()
// Paths page
sbISOPaths = new wxStaticBoxSizer(wxVERTICAL, PathsPage, _("ISO Directories"));
ISOPaths = new wxListBox(PathsPage, ID_ISOPATHS, wxDefaultPosition,
wxDefaultSize, arrayStringFor_ISOPaths, wxLB_SINGLE, wxDefaultValidator);
RecursiveISOPath = new wxCheckBox(PathsPage, ID_RECURSIVEISOPATH, _("Search Subfolders"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
AddISOPath = new wxButton(PathsPage, ID_ADDISOPATH, _("Add..."),
wxDefaultPosition, wxDefaultSize, 0);
RemoveISOPath = new wxButton(PathsPage, ID_REMOVEISOPATH, _("Remove"),
wxDefaultPosition, wxDefaultSize, 0);
ISOPaths = new wxListBox(PathsPage, ID_ISOPATHS, wxDefaultPosition, wxDefaultSize, arrayStringFor_ISOPaths, wxLB_SINGLE, wxDefaultValidator);
RecursiveISOPath = new wxCheckBox(PathsPage, ID_RECURSIVEISOPATH, _("Search Subfolders"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
AddISOPath = new wxButton(PathsPage, ID_ADDISOPATH, _("Add..."), wxDefaultPosition, wxDefaultSize, 0);
RemoveISOPath = new wxButton(PathsPage, ID_REMOVEISOPATH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0);
RemoveISOPath->Enable(false);
DefaultISO = new wxFilePickerCtrl(PathsPage, ID_DEFAULTISO, wxEmptyString,
_("Choose a default ISO:"),
_("All GC/Wii images (gcm, iso, ciso, gcz)") + wxString::Format(wxT("|*.gcm;*.iso;*.ciso;*.gcz|%s"),
wxGetTranslation(wxALL_FILES)),
wxDefaultPosition, wxDefaultSize, wxFLP_USE_TEXTCTRL|wxFLP_OPEN);
DVDRoot = new wxDirPickerCtrl(PathsPage, ID_DVDROOT, wxEmptyString,
_("Choose a DVD root directory:"), wxDefaultPosition, wxDefaultSize, wxDIRP_USE_TEXTCTRL);
ApploaderPath = new wxFilePickerCtrl(PathsPage, ID_APPLOADERPATH, wxEmptyString,
_("Choose file to use as apploader: (applies to discs constructed from directories only)"),
_("apploader (.img)") + wxString::Format(wxT("|*.img|%s"), wxGetTranslation(wxALL_FILES)),
wxDefaultPosition, wxDefaultSize, wxFLP_USE_TEXTCTRL|wxFLP_OPEN);
DefaultISO = new wxFilePickerCtrl(PathsPage, ID_DEFAULTISO, wxEmptyString, _("Choose a default ISO:"),
_("All GC/Wii images (gcm, iso, ciso, gcz)") + wxString::Format(wxT("|*.gcm;*.iso;*.ciso;*.gcz|%s"), wxGetTranslation(wxALL_FILES)),
wxDefaultPosition, wxDefaultSize, wxFLP_USE_TEXTCTRL|wxFLP_OPEN);
DVDRoot = new wxDirPickerCtrl(PathsPage, ID_DVDROOT, wxEmptyString, _("Choose a DVD root directory:"), wxDefaultPosition, wxDefaultSize, wxDIRP_USE_TEXTCTRL);
ApploaderPath = new wxFilePickerCtrl(PathsPage, ID_APPLOADERPATH, wxEmptyString, _("Choose file to use as apploader: (applies to discs constructed from directories only)"),
_("apploader (.img)") + wxString::Format(wxT("|*.img|%s"), wxGetTranslation(wxALL_FILES)),
wxDefaultPosition, wxDefaultSize, wxFLP_USE_TEXTCTRL|wxFLP_OPEN);
// Populate the settings
sbISOPaths->Add(ISOPaths, 1, wxEXPAND|wxALL, 0);
@ -948,6 +875,25 @@ void CConfigMain::CreateGUIControls()
sPathsPage->Add(sOtherPaths, 0, wxEXPAND|wxALL, 5);
PathsPage->SetSizer(sPathsPage);
#if defined _WIN32 || defined __linux__
// Plugins page
//sbGraphicsPlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginsPage, _("Graphics"));
//GraphicSelection = new wxChoice(PluginsPage, ID_GRAPHIC_CB, wxDefaultPosition, wxDefaultSize, 0, NULL, 0, wxDefaultValidator);
//GraphicConfig = new wxButton(PluginsPage, ID_GRAPHIC_CONFIG, _("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
//// Populate the settings
//sbGraphicsPlugin->Add(GraphicSelection, 1, wxEXPAND|wxALL, 5);
//sbGraphicsPlugin->Add(GraphicConfig, 0, wxALL, 5);
//// Populate the Plugins page
//sPluginsPage = new wxBoxSizer(wxVERTICAL);
//sPluginsPage->Add(sbGraphicsPlugin, 0, wxEXPAND|wxALL, 5);
//PluginsPage->SetSizer(sPluginsPage);
#endif
m_Ok = new wxButton(this, wxID_OK);
wxBoxSizer* sButtons = new wxBoxSizer(wxHORIZONTAL);
@ -1102,13 +1048,14 @@ void CConfigMain::AudioSettingsChanged(wxCommandEvent& event)
ac_Config.m_EnableJIT = DSPEngine->GetSelection() == 1;
ac_Config.Update();
break;
case ID_BACKEND:
VolumeSlider->Enable(SupportsVolumeChanges(std::string(BackendSelection->GetStringSelection().mb_str())));
break;
case ID_VOLUME:
ac_Config.m_Volume = VolumeSlider->GetValue();
ac_Config.Update();
VolumeText->SetLabel(wxString::Format(wxT("%d %%"), VolumeSlider->GetValue()));
break;
case ID_BACKEND:
VolumeSlider->Enable(SupportsVolumeChanges(std::string(BackendSelection->GetStringSelection().mb_str())));
default:
ac_Config.m_EnableDTKMusic = EnableDTKMusic->GetValue();
ac_Config.m_EnableThrottle = EnableThrottle->GetValue();
@ -1388,88 +1335,16 @@ void CConfigMain::ApploaderPathChanged(wxFileDirPickerEvent& WXUNUSED (event))
// Plugin settings
void CConfigMain::OnSelectionChanged(wxCommandEvent& WXUNUSED (event))
void CConfigMain::OnSelectionChanged(wxCommandEvent& ev)
{
// Update plugin filenames
if (GetFilename(GraphicSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin))
CPluginManager::GetInstance().FreeVideo();
g_video_backend = g_available_video_backends[ev.GetInt()];
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin = g_video_backend->GetName();
}
void CConfigMain::OnConfig(wxCommandEvent& event)
void CConfigMain::OnConfig(wxCommandEvent&)
{
switch (event.GetId())
{
case ID_GRAPHIC_CONFIG:
CallConfig(GraphicSelection);
break;
}
}
void CConfigMain::CallConfig(wxChoice* _pChoice)
{
int Index = _pChoice->GetSelection();
INFO_LOG(CONSOLE, "CallConfig: %i\n", Index);
if (Index >= 0)
{
const CPluginInfo* pInfo = static_cast<CPluginInfo*>(_pChoice->GetClientData(Index));
if (pInfo != NULL)
{
#ifdef _WIN32
// Make sure only one dialog can be opened at a time in Windows,
// but is unnecessary and looks bad in linux.
Disable();
#endif
CPluginManager::GetInstance().OpenConfig(this,
pInfo->GetFilename().c_str(), pInfo->GetPluginInfo().Type);
#ifdef _WIN32
Enable();
Raise();
#endif
}
}
}
void CConfigMain::FillChoiceBox(wxChoice* _pChoice, int _PluginType, const std::string& _SelectFilename)
{
_pChoice->Clear();
int Index = -1;
const CPluginInfos& rInfos = CPluginManager::GetInstance().GetPluginInfos();
for (size_t i = 0; i < rInfos.size(); i++)
{
const PLUGIN_INFO& rPluginInfo = rInfos[i].GetPluginInfo();
if (rPluginInfo.Type == _PluginType)
{
wxString temp;
temp = wxGetTranslation(wxString::FromUTF8(rInfos[i].GetPluginInfo().Name));
int NewIndex = _pChoice->Append(temp, (void*)&rInfos[i]);
if (rInfos[i].GetFilename() == _SelectFilename)
{
Index = NewIndex;
}
}
}
_pChoice->Select(Index);
}
bool CConfigMain::GetFilename(wxChoice* _pChoice, std::string& _rFilename)
{
_rFilename.clear();
int Index = _pChoice->GetSelection();
if (Index >= 0)
{
const CPluginInfo* pInfo = static_cast<CPluginInfo*>(_pChoice->GetClientData(Index));
_rFilename = pInfo->GetFilename();
INFO_LOG(CONSOLE, "GetFilename: %i %s\n", Index, _rFilename.c_str());
return(true);
}
return(false);
if (g_video_backend)
g_video_backend->ShowConfig(this);
}
// Search for avaliable resolutions
@ -1537,4 +1412,4 @@ void CConfigMain::AddResolutions()
}
}
#endif
}
}

View File

@ -57,7 +57,6 @@ public:
ID_GAMECUBEPAGE,
ID_WIIPAGE,
ID_PATHSPAGE,
ID_PLUGINPAGE,
};
private:
@ -75,7 +74,6 @@ private:
ID_LOCKTHREADS,
ID_DSPTHREAD,
ID_DISPLAY_FULLSCREENRES,
ID_DISPLAY_WINDOWWIDTH,
ID_DISPLAY_WINDOWHEIGHT,
@ -102,7 +100,6 @@ private:
ID_INTERFACE_LANG,
ID_HOTKEY_CONFIG,
ID_GC_SRAM_LNG,
ID_GC_EXIDEVICE_SLOTA,
@ -298,9 +295,6 @@ private:
void DVDRootChanged(wxFileDirPickerEvent& event);
void ApploaderPathChanged(wxFileDirPickerEvent& WXUNUSED (event));
void FillChoiceBox(wxChoice* _pChoice, int _PluginType, const std::string& _SelectFilename);
void CallConfig(wxChoice* _pChoice);
bool GetFilename(wxChoice* _pChoice, std::string& _rFilename);
DECLARE_EVENT_TABLE();
};
#endif

View File

@ -31,7 +31,6 @@
#include "Globals.h" // Local
#include "Frame.h"
#include "ConfigMain.h"
#include "PluginManager.h"
#include "CheatsWindow.h"
#include "AboutDolphin.h"
#include "GameListCtrl.h"
@ -46,6 +45,8 @@
#include "State.h"
#include "VolumeHandler.h"
#include "VideoBackendBase.h"
#include <wx/datetime.h> // wxWidgets
// Resources
@ -429,9 +430,6 @@ CFrame::CFrame(wxFrame* parent,
m_LogWindow->Hide();
m_LogWindow->Disable();
// Create list of available plugins for the configuration window
CPluginManager::GetInstance().ScanForPlugins();
// Setup perspectives
if (g_pCodeWindow)
{

View File

@ -27,7 +27,6 @@
#include "Globals.h" // Local
#include "Frame.h"
#include "ConfigMain.h"
#include "PluginManager.h"
#include "CheatsWindow.h"
#include "AboutDolphin.h"
#include "GameListCtrl.h"

View File

@ -35,11 +35,11 @@ Core::GetWindowHandle().
#include "FileUtil.h"
#include "FileSearch.h"
#include "Timer.h"
#include "VideoBackendBase.h"
#include "Globals.h" // Local
#include "Frame.h"
#include "ConfigMain.h"
#include "PluginManager.h"
#include "MemcardManager.h"
#include "CheatsWindow.h"
#include "LuaWindow.h"
@ -979,7 +979,7 @@ void CFrame::DoStop()
(wxObject*)0, this);
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
m_RenderParent->SetCursor(wxCURSOR_ARROW);
DoFullscreen(FALSE);
DoFullscreen(false);
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)
m_RenderFrame->Destroy();
m_RenderParent = NULL;
@ -1051,18 +1051,8 @@ void CFrame::OnConfigMain(wxCommandEvent& WXUNUSED (event))
void CFrame::OnPluginGFX(wxCommandEvent& WXUNUSED (event))
{
#ifdef _WIN32
Disable(); // Fake a modal dialog
#endif
CPluginManager::GetInstance().OpenConfig(
this,
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
PLUGIN_TYPE_VIDEO
);
#ifdef _WIN32
Enable();
Raise();
#endif
if (g_video_backend)
g_video_backend->ShowConfig(this);
}
void CFrame::OnPluginDSP(wxCommandEvent& WXUNUSED (event))

View File

@ -31,7 +31,6 @@
#include "Setup.h"
#include "Host.h" // Core
#include "PluginManager.h"
#include "HW/Wiimote.h"
#include "Globals.h" // Local
@ -43,6 +42,8 @@
#include "BootManager.h"
#include "Frame.h"
#include "VideoBackendBase.h"
#include <wx/intl.h>
// ------------
@ -283,13 +284,15 @@ bool DolphinApp::OnInit()
LogManager::Init();
SConfig::Init();
CPluginManager::Init();
VideoBackend::PopulateList();
WiimoteReal::LoadSettings();
if (selectVideoPlugin && videoPluginFilename != wxEmptyString)
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin =
std::string(videoPluginFilename.mb_str());
VideoBackend::ActivateBackend(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin);
// Enable the PNG image handler for screenshots
wxImage::AddHandler(new wxPNGHandler);
@ -420,7 +423,7 @@ int DolphinApp::OnExit()
if (SConfig::GetInstance().m_WiiAutoUnpair)
WiimoteReal::UnPair();
#endif
CPluginManager::Shutdown();
VideoBackend::ClearList();
SConfig::Shutdown();
LogManager::Shutdown();
@ -438,8 +441,6 @@ void DolphinApp::OnFatalException()
// ------------
// Talk to GUI
// g_VideoInitialize.pSysMessage() goes here
void Host_SysMessage(const char *fmt, ...)
{
va_list list;

View File

@ -22,6 +22,8 @@
#include "VertexManagerBase.h"
#include "VertexShaderManager.h"
#include "VideoConfig.h"
#include "HW/Memmap.h"
#include "ConfigManager.h"
bool textureChanged[8];
const bool renderFog = false;
@ -202,7 +204,7 @@ bool GetConfig(const int &type)
switch (type)
{
case CONFIG_ISWII:
return g_VideoInitialize.bWii;
return SConfig::GetInstance().m_LocalCoreStartupParameter.bWii;
case CONFIG_DISABLEFOG:
return g_ActiveConfig.bDisableFog;
case CONFIG_SHOWEFBREGIONS:
@ -215,7 +217,7 @@ bool GetConfig(const int &type)
u8 *GetPointer(const u32 &address)
{
return g_VideoInitialize.pGetMemoryPointer(address);
return Memory::GetPointer(address);
}
void SetTextureMode(const BPCmd &bp)

View File

@ -78,10 +78,20 @@
#include "ChunkFile.h"
#include "CommandProcessor.h"
#include "PixelEngine.h"
#include "CoreTiming.h"
#include "ConfigManager.h"
#include "HW/ProcessorInterface.h"
#include "HW/GPFifo.h"
#include "HW/Memmap.h"
namespace CommandProcessor
{
bool IsOnThread()
{
return SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread;
}
int et_UpdateInterrupts;
@ -185,7 +195,7 @@ void Init()
s_fifoIdleEvent.Init();
et_UpdateInterrupts = g_VideoInitialize.pRegisterEvent("UpdateInterrupts", UpdateInterrupts_Wrapper);
et_UpdateInterrupts = CoreTiming::RegisterEvent("UpdateInterrupts", UpdateInterrupts_Wrapper);
}
void Shutdown()
@ -204,7 +214,7 @@ void Read16(u16& _rReturnValue, const u32 _Address)
// Here always there is one fifo attached to the GPU
if (g_VideoInitialize.bOnThread)
if (IsOnThread())
{
m_CPStatusReg.Breakpoint = fifo.bFF_Breakpoint;
m_CPStatusReg.ReadIdle = (fifo.CPReadPointer == fifo.CPWritePointer) || (fifo.CPReadPointer == fifo.CPBreakpoint);
@ -406,7 +416,7 @@ void Write16(const u16 _Value, const u32 _Address)
// (mb2) We don't sleep here since it could be a perf issue for super monkey ball (yup only this game IIRC)
// Touching that game is a no-go so I don't want to take the risk :p
if (g_VideoInitialize.bOnThread)
if (IsOnThread())
{
//ProcessFifoAllDistance();
@ -437,7 +447,7 @@ void Write16(const u16 _Value, const u32 _Address)
// seems invalid or has a bug and hang the game.
// Single Core MODE
if (!g_VideoInitialize.bOnThread)
if (!IsOnThread())
{
Common::AtomicStore(fifo.bFF_Breakpoint, false);
@ -463,9 +473,9 @@ void Write16(const u16 _Value, const u32 _Address)
if(tmpCtrl.GPReadEnable && tmpCtrl.GPLinkEnable)
{
*(g_VideoInitialize.Fifo_CPUWritePointer) = fifo.CPWritePointer;
*(g_VideoInitialize.Fifo_CPUBase) = fifo.CPBase;
*(g_VideoInitialize.Fifo_CPUEnd) = fifo.CPEnd;
ProcessorInterface::Fifo_CPUWritePointer = fifo.CPWritePointer;
ProcessorInterface::Fifo_CPUBase = fifo.CPBase;
ProcessorInterface::Fifo_CPUEnd = fifo.CPEnd;
}
// If overflown happens process the fifo to LoWatemark
if (bProcessFifoToLoWatemark)
@ -488,7 +498,7 @@ void Write16(const u16 _Value, const u32 _Address)
{
UCPClearReg tmpCtrl(_Value);
if (g_VideoInitialize.bOnThread)
if (IsOnThread())
{
if (!tmpCtrl.ClearFifoUnderflow && tmpCtrl.ClearFifoOverflow)
bProcessFifoToLoWatemark = true;
@ -607,7 +617,7 @@ void Write16(const u16 _Value, const u32 _Address)
WARN_LOG(COMMANDPROCESSOR, "(w16) unknown CP reg write %04x @ %08x", _Value, _Address);
}
if (!g_VideoInitialize.bOnThread)
if (!IsOnThread())
CatchUpGPU();
ProcessFifoEvents();
}
@ -648,12 +658,12 @@ void STACKALIGN GatherPipeBursted()
// if we aren't linked, we don't care about gather pipe data
if (!m_CPCtrlReg.GPLinkEnable)
{
if (!g_VideoInitialize.bOnThread)
if (!IsOnThread())
CatchUpGPU();
return;
}
if (g_VideoInitialize.bOnThread)
if (IsOnThread())
SetOverflowStatusFromGatherPipe();
@ -667,7 +677,7 @@ void STACKALIGN GatherPipeBursted()
if (!g_VideoInitialize.bOnThread)
if (!IsOnThread())
{
CatchUpGPU();
if (!m_CPStatusReg.OverflowHiWatermark && fifo.CPReadWriteDistance >= fifo.CPHiWatermark)
@ -703,17 +713,17 @@ void STACKALIGN GatherPipeBursted()
"FIFO is overflown by GatherPipe !\nCPU thread is too fast!");
// check if we are in sync
_assert_msg_(COMMANDPROCESSOR, fifo.CPWritePointer == *(g_VideoInitialize.Fifo_CPUWritePointer), "FIFOs linked but out of sync");
_assert_msg_(COMMANDPROCESSOR, fifo.CPBase == *(g_VideoInitialize.Fifo_CPUBase), "FIFOs linked but out of sync");
_assert_msg_(COMMANDPROCESSOR, fifo.CPEnd == *(g_VideoInitialize.Fifo_CPUEnd), "FIFOs linked but out of sync");
_assert_msg_(COMMANDPROCESSOR, fifo.CPWritePointer == ProcessorInterface::Fifo_CPUWritePointer, "FIFOs linked but out of sync");
_assert_msg_(COMMANDPROCESSOR, fifo.CPBase == ProcessorInterface::Fifo_CPUBase, "FIFOs linked but out of sync");
_assert_msg_(COMMANDPROCESSOR, fifo.CPEnd == ProcessorInterface::Fifo_CPUEnd, "FIFOs linked but out of sync");
}
// This is only used in single core mode
void CatchUpGPU()
{
// HyperIris: Memory_GetPtr is an expensive call, call it less, run faster
u8 *ptr = Memory_GetPtr(fifo.CPReadPointer);
// HyperIris: Memory::GetPointer is an expensive call, call it less, run faster
u8 *ptr = Memory::GetPointer(fifo.CPReadPointer);
// check if we are able to run this buffer
while (fifo.bFF_GPReadEnable && (fifo.CPReadWriteDistance ||
@ -767,31 +777,29 @@ void UpdateInterruptsScMode()
|| (m_CPCtrlReg.FifoUnderflowIntEnable && fifo.bFF_LoWatermark)
|| (m_CPCtrlReg.FifoOverflowIntEnable && m_CPStatusReg.OverflowHiWatermark);
INFO_LOG(COMMANDPROCESSOR, "Fifo Interrupt: %s", (active)? "Asserted" : "Deasserted");
g_VideoInitialize.pSetInterrupt(INT_CAUSE_CP, active);
ProcessorInterface::SetInterrupt(INT_CAUSE_CP, active);
}
void UpdateInterrupts(u64 userdata)
{
if (userdata)
{
interruptSet = true;
INFO_LOG(COMMANDPROCESSOR,"Interrupt set");
g_VideoInitialize.pSetInterrupt(INT_CAUSE_CP, true);
ProcessorInterface::SetInterrupt(INT_CAUSE_CP, true);
}
else
{
interruptSet = false;
INFO_LOG(COMMANDPROCESSOR,"Interrupt cleared");
g_VideoInitialize.pSetInterrupt(INT_CAUSE_CP, false);
ProcessorInterface::SetInterrupt(INT_CAUSE_CP, false);
}
interruptWaiting = false;
}
void UpdateInterruptsFromVideoPlugin(u64 userdata)
{
g_VideoInitialize.pScheduleEvent_Threadsafe(0, et_UpdateInterrupts, userdata);
CoreTiming::ScheduleEvent_Threadsafe(0, et_UpdateInterrupts, userdata);
}
void SetFifoIdleFromVideoPlugin()
@ -807,8 +815,8 @@ void AbortFrame()
{
fifo.bFF_GPReadEnable = false;
while (CommandProcessor::isFifoBusy)
Common::YieldCPU();
g_VideoInitialize.pResetGatherPipe();
Common::YieldCPU();
GPFifo::ResetGatherPipe();
ResetVideoBuffer();
fifo.CPReadPointer = fifo.CPWritePointer;
fifo.CPReadWriteDistance = 0;
@ -876,7 +884,7 @@ void SetStatus()
if (interrupt != interruptSet && !interruptWaiting)
{
u64 userdata = interrupt?1:0;
if (g_VideoInitialize.bOnThread)
if (IsOnThread())
{
interruptWaiting = true;
CommandProcessor::UpdateInterruptsFromVideoPlugin(userdata);
@ -890,7 +898,7 @@ void SetStatus()
void ProcessFifoToLoWatemark()
{
if (g_VideoInitialize.bOnThread)
if (IsOnThread())
{
while (!CommandProcessor::interruptWaiting && fifo.bFF_GPReadEnable &&
fifo.CPReadWriteDistance > fifo.CPLoWatermark && !AtBreakpoint())
@ -901,7 +909,7 @@ void ProcessFifoToLoWatemark()
void ProcessFifoAllDistance()
{
if (g_VideoInitialize.bOnThread)
if (IsOnThread())
{
while (!CommandProcessor::interruptWaiting && fifo.bFF_GPReadEnable &&
fifo.CPReadWriteDistance && !AtBreakpoint())
@ -912,8 +920,8 @@ void ProcessFifoAllDistance()
void ProcessFifoEvents()
{
if (g_VideoInitialize.bOnThread && (interruptWaiting || interruptFinishWaiting || interruptTokenWaiting))
g_VideoInitialize.pProcessFifoEvents();
if (IsOnThread() && (interruptWaiting || interruptFinishWaiting || interruptTokenWaiting))
CoreTiming::ProcessFifoWaitEvents();
}

View File

@ -19,7 +19,7 @@
#define _COMMANDPROCESSOR_H
#include "Common.h"
#include "pluginspecs_video.h"
#include "VideoBackendBase.h"
class PointerWrap;

View File

@ -26,6 +26,7 @@
#include "DataReader.h"
#include "Statistics.h"
#include "OpcodeDecoding.h" // For the GX_ constants.
#include "HW/Memmap.h"
#include "XFMemory.h"
#include "CPMemory.h"
@ -281,9 +282,9 @@ u8 AnalyzeAndRunDisplayList(u32 address, int size, CachedDisplayList *dl)
int num_draw_call = 0;
u8 result = 0;
u8* old_pVideoData = g_pVideoData;
u8* startAddress = Memory_GetPtr(address);
u8* startAddress = Memory::GetPointer(address);
// Avoid the crash if Memory_GetPtr failed ..
// Avoid the crash if Memory::GetPointer failed ..
if (startAddress != 0)
{
g_pVideoData = startAddress;
@ -417,9 +418,9 @@ u8 AnalyzeAndRunDisplayList(u32 address, int size, CachedDisplayList *dl)
bool CompileAndRunDisplayList(u32 address, int size, CachedDisplayList *dl)
{
u8* old_pVideoData = g_pVideoData;
u8* startAddress = Memory_GetPtr(address);
u8* startAddress = Memory::GetPointer(address);
// Avoid the crash if Memory_GetPtr failed ..
// Avoid the crash if Memory::GetPointer failed ..
if (startAddress != 0)
{
g_pVideoData = startAddress;
@ -707,7 +708,7 @@ bool HandleDisplayList(u32 address, u32 size)
{
case DLCache::DLPASS_COMPILE:
// First, check that the hash is the same as the last time.
if (dl.dl_hash != GetHash64(Memory_GetPtr(address), size, 0))
if (dl.dl_hash != GetHash64(Memory::GetPointer(address), size, 0))
{
// PanicAlert("uncachable %08x", address);
dl.uncachable = true;
@ -722,7 +723,7 @@ bool HandleDisplayList(u32 address, u32 size)
dl.check--;
if (dl.check <= 0)
{
if (dl.dl_hash != GetHash64(Memory_GetPtr(address), size, 0) || !dl.CheckRegions())
if (dl.dl_hash != GetHash64(Memory::GetPointer(address), size, 0) || !dl.CheckRegions())
{
dl.uncachable = true;
dl.check = 60;
@ -760,7 +761,7 @@ bool HandleDisplayList(u32 address, u32 size)
DLCache::CachedDisplayList dl;
u8 dlvatused = DLCache::AnalyzeAndRunDisplayList(address, size, &dl);
dl.dl_hash = GetHash64(Memory_GetPtr(address), size,0);
dl.dl_hash = GetHash64(Memory::GetPointer(address), size,0);
dl.pass = DLCache::DLPASS_COMPILE;
dl.check = 1;
dl.next_check = 1;

View File

@ -31,7 +31,7 @@ volatile bool GFXDebuggerPauseFlag = false;
volatile PauseEvent GFXDebuggerToPauseAtNext = NOT_PAUSE;
volatile int GFXDebuggerEventToPauseCount = 0;
void UpdateFPSDisplay(const char *text);
//void UpdateFPSDisplay(const char *text);
extern NativeVertexFormat *g_nativeVertexFmt;
void GFXDebuggerUpdateScreen()
@ -69,7 +69,7 @@ void GFXDebuggerCheckAndPause(bool update)
g_pdebugger->OnPause();
while( GFXDebuggerPauseFlag )
{
UpdateFPSDisplay("Paused by Video Debugger");
g_video_backend->UpdateFPSDisplay("Paused by Video Debugger");
if (update) GFXDebuggerUpdateScreen();
SLEEP(5);

View File

@ -22,7 +22,8 @@
#include "Fifo.h"
#include "VertexShaderManager.h"
#include "RenderBase.h"
#include "VideoBackendBase.h"
#include "Core.h"
int OSDChoice = 0 , OSDTime = 0, OSDInternalW = 0, OSDInternalH = 0;
@ -223,7 +224,7 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
return true;
case WM_DESTROY:
Shutdown();
g_video_backend->Shutdown();
break;
default:
return DefWindowProc(hWnd, iMsg, wParam, lParam);
@ -323,7 +324,7 @@ HWND Create(HWND hParent, HINSTANCE hInstance, const TCHAR *title)
// 3. Request window sizes which actually make the client area map to a common resolution
HWND Ret;
int x=0, y=0, width=640, height=480;
g_VideoInitialize.pGetWindowSize(x, y, width, height);
Core::Callback_VideoGetWindowSize(x, y, width, height);
// TODO: Don't show if fullscreen
Ret = OpenWindow(hParent, hInstance, width, height, title);

View File

@ -24,6 +24,7 @@
#include "CommandProcessor.h"
#include "ChunkFile.h"
#include "Fifo.h"
#include "HW/Memmap.h"
volatile bool g_bSkipCurrentFrame = false;
volatile bool g_EFBAccessRequested = false;
@ -134,16 +135,15 @@ void ResetVideoBuffer()
// Description: Main FIFO update loop
// Purpose: Keep the Core HW updated about the CPU-GPU distance
void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
void Fifo_EnterLoop()
{
fifoStateRun = true;
SCPFifoStruct &_fifo = CommandProcessor::fifo;
s32 distToSend;
while (fifoStateRun)
{
video_initialize.pPeekMessages();
g_video_backend->PeekMessages();
VideoFifo_CheckAsyncRequest();
@ -164,7 +164,7 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
// Create pointer to video data and send it to the VideoPlugin
u32 readPtr = _fifo.CPReadPointer;
u8 *uData = video_initialize.pGetMemoryPointer(readPtr);
u8 *uData = Memory::GetPointer(readPtr);
distToSend = 32;
@ -204,7 +204,7 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
// While the emu is paused, we still handle async request such as Savestates then sleep.
while (!EmuRunning)
{
video_initialize.pPeekMessages();
g_video_backend->PeekMessages();
VideoFifo_CheckAsyncRequest();
Common::SleepCurrentThread(10);
}

View File

@ -18,8 +18,8 @@
#ifndef _FIFO_H
#define _FIFO_H
#include "pluginspecs_video.h"
#include "Common.h"
#include "VideoBackendBase.h"
class PointerWrap;
@ -34,7 +34,7 @@ void Fifo_Shutdown();
void Fifo_SendFifoData(u8* _uData, u32 len);
// These two are for dual core mode only.
void Fifo_EnterLoop(const SVideoInitialize &video_initialize);
void Fifo_EnterLoop();
void Fifo_ExitLoop();
void Fifo_ExitLoopNonBlocking();
void Fifo_RunLoop(bool run);

View File

@ -12,6 +12,8 @@
#include "Fifo.h"
#include "BPStructs.h"
#include "OnScreenDisplay.h"
#include "VideoBackendBase.h"
#include "ConfigManager.h"
bool s_PluginInitialized = false;
@ -37,25 +39,24 @@ static struct
static u32 s_AccessEFBResult = 0;
void EmuStateChange(PLUGIN_EMUSTATE newState)
void VideoBackendHLE::EmuStateChange(PLUGIN_EMUSTATE newState)
{
Fifo_RunLoop((newState == PLUGIN_EMUSTATE_PLAY) ? true : false);
}
// Enter and exit the video loop
void Video_EnterLoop()
void VideoBackendHLE::Video_EnterLoop()
{
Fifo_EnterLoop(g_VideoInitialize);
Fifo_EnterLoop();
}
void Video_ExitLoop()
void VideoBackendHLE::Video_ExitLoop()
{
Fifo_ExitLoop();
s_FifoShuttingDown = true;
}
void Video_SetRendering(bool bEnabled)
void VideoBackendHLE::Video_SetRendering(bool bEnabled)
{
Fifo_SetRendering(bEnabled);
}
@ -93,11 +94,11 @@ void VideoFifo_CheckSwapRequestAt(u32 xfbAddr, u32 fbWidth, u32 fbHeight)
}
// Run from the CPU thread (from VideoInterface.cpp)
void Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
void VideoBackendHLE::Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
{
if (s_PluginInitialized && g_ActiveConfig.bUseXFB)
{
if (!g_VideoInitialize.bOnThread)
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread)
VideoFifo_CheckSwapRequest();
s_beginFieldArgs.xfbAddr = xfbAddr;
s_beginFieldArgs.field = field;
@ -107,7 +108,7 @@ void Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
}
// Run from the CPU thread (from VideoInterface.cpp)
void Video_EndField()
void VideoBackendHLE::Video_EndField()
{
if (s_PluginInitialized)
{
@ -115,15 +116,16 @@ void Video_EndField()
}
}
void Video_AddMessage(const char* pstr, u32 milliseconds)
void VideoBackendHLE::Video_AddMessage(const char* pstr, u32 milliseconds)
{
OSD::AddMessage(pstr, milliseconds);
}
// Screenshot
void Video_Screenshot(const char *_szFilename)
bool VideoBackendHLE::Video_Screenshot(const char *_szFilename)
{
Renderer::SetScreenshot(_szFilename);
return true;
}
void VideoFifo_CheckEFBAccess()
@ -136,7 +138,7 @@ void VideoFifo_CheckEFBAccess()
}
}
u32 Video_AccessEFB(EFBAccessType type, u32 x, u32 y, u32 InputData)
u32 VideoBackendHLE::Video_AccessEFB(EFBAccessType type, u32 x, u32 y, u32 InputData)
{
if (s_PluginInitialized)
{
@ -147,7 +149,7 @@ u32 Video_AccessEFB(EFBAccessType type, u32 x, u32 y, u32 InputData)
Common::AtomicStoreRelease(s_efbAccessRequested, TRUE);
if (g_VideoInitialize.bOnThread)
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread)
{
while (Common::AtomicLoadAcquire(s_efbAccessRequested) && !s_FifoShuttingDown)
//Common::SleepCurrentThread(1);
@ -196,12 +198,12 @@ static void check_DoState() {
}
// Run from the CPU thread
void DoState(unsigned char **ptr, int mode)
void VideoBackendHLE::DoState(PointerWrap& p)
{
s_doStateArgs.ptr = ptr;
s_doStateArgs.mode = mode;
s_doStateArgs.ptr = p.ptr;
s_doStateArgs.mode = p.mode;
Common::AtomicStoreRelease(s_doStateRequested, TRUE);
if (g_VideoInitialize.bOnThread)
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread)
{
while (Common::AtomicLoadAcquire(s_doStateRequested) && !s_FifoShuttingDown)
//Common::SleepCurrentThread(1);
@ -218,47 +220,22 @@ void VideoFifo_CheckAsyncRequest()
check_DoState();
}
void Video_CommandProcessorRead16(u16& _rReturnValue, const u32 _Address)
{
CommandProcessor::Read16(_rReturnValue, _Address);
}
void Video_CommandProcessorWrite16(const u16 _Data, const u32 _Address)
{
CommandProcessor::Write16(_Data, _Address);
}
void Video_PixelEngineRead16(u16& _rReturnValue, const u32 _Address)
{
PixelEngine::Read16(_rReturnValue, _Address);
}
void Video_PixelEngineWrite16(const u16 _Data, const u32 _Address)
{
PixelEngine::Write16(_Data, _Address);
}
void Video_PixelEngineWrite32(const u32 _Data, const u32 _Address)
{
PixelEngine::Write32(_Data, _Address);
}
void Video_GatherPipeBursted(void)
void VideoBackend::Video_GatherPipeBursted()
{
CommandProcessor::GatherPipeBursted();
}
void Video_WaitForFrameFinish(void)
void VideoBackendHLE::Video_WaitForFrameFinish()
{
CommandProcessor::WaitForFrameFinish();
}
bool Video_IsFifoBusy(void)
bool VideoBackendHLE::Video_IsFifoBusy()
{
return CommandProcessor::isFifoBusy;
}
void Video_AbortFrame(void)
void VideoBackendHLE::Video_AbortFrame()
{
CommandProcessor::AbortFrame();
}

View File

@ -30,6 +30,9 @@
#include "OpcodeDecoding.h"
#include "CommandProcessor.h"
#include "CPUDetect.h"
#include "Core.h"
#include "Host.h"
#include "HW/Memmap.h"
#include "VertexLoaderManager.h"
@ -95,9 +98,9 @@ static void Decode();
void InterpretDisplayList(u32 address, u32 size)
{
u8* old_pVideoData = g_pVideoData;
u8* startAddress = Memory_GetPtr(address);
u8* startAddress = Memory::GetPointer(address);
// Avoid the crash if Memory_GetPtr failed ..
// Avoid the crash if Memory::GetPointer failed ..
if (startAddress != 0)
{
g_pVideoData = startAddress;
@ -201,16 +204,16 @@ bool FifoCommandRunnable()
else
{
// TODO(Omega): Maybe dump FIFO to file on this error
char szTemp[1024];
sprintf(szTemp, "GFX FIFO: Unknown Opcode (0x%x).\n"
char szTemp[1024];
sprintf(szTemp, "GFX FIFO: Unknown Opcode (0x%x).\n"
"This means one of the following:\n"
"* The emulated GPU got desynced, disabling dual core can help\n"
"* Command stream corrupted by some spurious memory bug\n"
"* This really is an unknown opcode (unlikely)\n"
"* Some other sort of bug\n\n"
"Dolphin will now likely crash or hang. Enjoy." , cmd_byte);
g_VideoInitialize.pSysMessage(szTemp);
g_VideoInitialize.pLog(szTemp, TRUE);
Host_SysMessage(szTemp);
Core::Callback_VideoLog(szTemp, TRUE);
{
SCPFifoStruct &fifo = CommandProcessor::fifo;
@ -234,8 +237,8 @@ bool FifoCommandRunnable()
,fifo.bFF_BPEnable ? "true" : "false" ,fifo.bFF_BPInt ? "true" : "false"
,fifo.bFF_Breakpoint ? "true" : "false");
g_VideoInitialize.pSysMessage(szTmp);
g_VideoInitialize.pLog(szTmp, TRUE);
Host_SysMessage(szTmp);
Core::Callback_VideoLog(szTmp, TRUE);
}
}
break;

View File

@ -24,9 +24,12 @@
#include "VideoCommon.h"
#include "ChunkFile.h"
#include "Atomic.h"
#include "CoreTiming.h"
#include "ConfigManager.h"
#include "PixelEngine.h"
#include "CommandProcessor.h"
#include "HW/ProcessorInterface.h"
namespace PixelEngine
{
@ -151,8 +154,8 @@ void Init()
{
m_Control.Hex = 0;
et_SetTokenOnMainThread = g_VideoInitialize.pRegisterEvent("SetToken", SetToken_OnMainThread);
et_SetFinishOnMainThread = g_VideoInitialize.pRegisterEvent("SetFinish", SetFinish_OnMainThread);
et_SetTokenOnMainThread = CoreTiming::RegisterEvent("SetToken", SetToken_OnMainThread);
et_SetFinishOnMainThread = CoreTiming::RegisterEvent("SetFinish", SetFinish_OnMainThread);
bbox[0] = 0x80;
bbox[1] = 0xA0;
@ -298,7 +301,7 @@ void Write32(const u32 _iValue, const u32 _iAddress)
bool AllowIdleSkipping()
{
return !g_VideoInitialize.bOnThread || (!m_Control.PETokenEnable && !m_Control.PEFinishEnable);
return !SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread || (!m_Control.PETokenEnable && !m_Control.PEFinishEnable);
}
void UpdateInterrupts()
@ -314,7 +317,7 @@ void UpdateTokenInterrupt(bool active)
{
if(interruptSetToken != active)
{
g_VideoInitialize.pSetInterrupt(INT_CAUSE_PE_TOKEN, active);
ProcessorInterface::SetInterrupt(INT_CAUSE_PE_TOKEN, active);
interruptSetToken = active;
}
}
@ -324,7 +327,7 @@ void UpdateFinishInterrupt(bool active)
if(interruptSetFinish != active)
{
g_VideoInitialize.pSetInterrupt(INT_CAUSE_PE_FINISH, active);
ProcessorInterface::SetInterrupt(INT_CAUSE_PE_FINISH, active);
interruptSetFinish = active;
}
}
@ -366,8 +369,7 @@ void SetToken(const u16 _token, const int _bSetTokenAcknowledge)
CommandProcessor::IncrementGPWDToken(); // for DC watchdog hack since PEToken seems to be a frame-finish too
Common::AtomicStore(*(volatile u32*)&CommandProcessor::fifo.PEToken, _token);
CommandProcessor::interruptTokenWaiting = true;
g_VideoInitialize.pScheduleEvent_Threadsafe(
0, et_SetTokenOnMainThread, _token | (_bSetTokenAcknowledge << 16));
CoreTiming::ScheduleEvent_Threadsafe(0, et_SetTokenOnMainThread, _token | (_bSetTokenAcknowledge << 16));
}
else // set token value
{
@ -386,8 +388,7 @@ void SetFinish()
{
CommandProcessor::IncrementGPWDToken(); // for DC watchdog hack
CommandProcessor::interruptFinishWaiting = true;
g_VideoInitialize.pScheduleEvent_Threadsafe(
0, et_SetFinishOnMainThread, 0);
CoreTiming::ScheduleEvent_Threadsafe(0, et_SetFinishOnMainThread, 0);
INFO_LOG(PIXELENGINE, "VIDEO Set Finish");
}
@ -401,9 +402,10 @@ void ResetSetFinish()
UpdateFinishInterrupt(false);
g_bSignalFinishInterrupt = false;
}else
}
else
{
g_VideoInitialize.pRemoveEvent(et_SetFinishOnMainThread);
CoreTiming::RemoveEvent(et_SetFinishOnMainThread);
}
CommandProcessor::interruptFinishWaiting = false;
}
@ -415,9 +417,10 @@ void ResetSetToken()
UpdateTokenInterrupt(false);
g_bSignalTokenInterrupt = false;
}else
}
else
{
g_VideoInitialize.pRemoveEvent(et_SetTokenOnMainThread);
CoreTiming::RemoveEvent(et_SetTokenOnMainThread);
}
CommandProcessor::interruptTokenWaiting = false;
}

View File

@ -22,7 +22,9 @@
#include "PixelShaderManager.h"
#include "VideoCommon.h"
#include "VideoConfig.h"
#include "RenderBase.h"
static float GC_ALIGNED16(s_fMaterials[16]);
static int s_nColorsChanged[2]; // 0 - regular colors, 1 - k colors
static int s_nIndTexMtxChanged;
@ -43,6 +45,21 @@ static u32 lastTexDims[8]; // width | height << 16 | wrap_s << 28 | wrap_t << 30
static u32 lastZBias;
static int nMaterialsChanged;
inline void SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4)
{
g_renderer->SetPSConstant4f(const_number, f1, f2, f3, f4);
}
inline void SetPSConstant4fv(unsigned int const_number, const float *f)
{
g_renderer->SetPSConstant4fv(const_number, f);
}
inline void SetMultiPSConstant4fv(unsigned int const_number, unsigned int count, const float *f)
{
g_renderer->SetMultiPSConstant4fv(const_number, count, f);
}
void PixelShaderManager::Init()
{
lastAlpha = 0;
@ -97,7 +114,7 @@ void PixelShaderManager::SetConstants()
if (s_bAlphaChanged)
{
SetPSConstant4f(C_ALPHA, (lastAlpha&0xff)/255.0f, ((lastAlpha>>8)&0xff)/255.0f, 0, ((lastAlpha>>16)&0xff)/255.0f);
SetPSConstant4f(C_ALPHA, (lastAlpha&0xff)/255.0f, ((lastAlpha>>8)&0xff)/255.0f, 0, ((lastAlpha>>16)&0xff)/255.0f);
s_bAlphaChanged = false;
}
@ -126,7 +143,7 @@ void PixelShaderManager::SetConstants()
if (s_bZBiasChanged || s_bDepthRangeChanged)
{
//ERROR_LOG("pixel=%x,%x, bias=%x\n", bpmem.zcontrol.pixel_format, bpmem.ztex2.type, lastZBias);
SetPSConstant4f(C_ZBIAS+1, lastDepthRange[0] / 16777216.0f, lastDepthRange[1] / 16777216.0f, 0, (float)(lastZBias)/16777215.0f);
SetPSConstant4f(C_ZBIAS+1, lastDepthRange[0] / 16777216.0f, lastDepthRange[1] / 16777216.0f, 0, (float)(lastZBias)/16777215.0f);
s_bZBiasChanged = s_bDepthRangeChanged = false;
}
@ -144,7 +161,7 @@ void PixelShaderManager::SetConstants()
f[2 * i + 1] = bpmem.texscale[0].getScaleT(i & 1);
PRIM_LOG("tex indscale%d: %f %f\n", i, f[2 * i], f[2 * i + 1]);
}
SetPSConstant4fv(C_INDTEXSCALE, f);
SetPSConstant4fv(C_INDTEXSCALE, f);
}
if (s_nIndTexScaleChanged & 0x0c) {
@ -153,7 +170,7 @@ void PixelShaderManager::SetConstants()
f[2 * i + 1] = bpmem.texscale[1].getScaleT(i & 1);
PRIM_LOG("tex indscale%d: %f %f\n", i, f[2 * i], f[2 * i + 1]);
}
SetPSConstant4fv(C_INDTEXSCALE+1, &f[4]);
SetPSConstant4fv(C_INDTEXSCALE+1, &f[4]);
}
s_nIndTexScaleChanged = 0;
@ -173,7 +190,7 @@ void PixelShaderManager::SetConstants()
// xyz - static matrix
// TODO w - dynamic matrix scale / 256...... somehow / 4 works better
// rev 2972 - now using / 256.... verify that this works
SetPSConstant4f(C_INDTEXMTX + 2 * i,
SetPSConstant4f(C_INDTEXMTX + 2 * i,
bpmem.indmtx[i].col0.ma * fscale,
bpmem.indmtx[i].col1.mc * fscale,
bpmem.indmtx[i].col2.me * fscale,
@ -195,8 +212,8 @@ void PixelShaderManager::SetConstants()
if (s_bFogColorChanged)
{
SetPSConstant4f(C_FOG, bpmem.fog.color.r / 255.0f, bpmem.fog.color.g / 255.0f, bpmem.fog.color.b / 255.0f, 0);
s_bFogColorChanged = false;
SetPSConstant4f(C_FOG, bpmem.fog.color.r / 255.0f, bpmem.fog.color.g / 255.0f, bpmem.fog.color.b / 255.0f, 0);
s_bFogColorChanged = false;
}
if (s_bFogParamChanged)

View File

@ -22,10 +22,6 @@
#include "XFMemory.h"
#include "PixelShaderGen.h"
void SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4);
void SetPSConstant4fv(unsigned int const_number, const float *f);
void SetMultiPSConstant4fv(unsigned int const_number, unsigned int count, const float *f);
// The non-API dependent parts.
class PixelShaderManager
{

View File

@ -42,9 +42,6 @@
int frameCount;
//int OSDChoice, OSDTime, OSDInternalW, OSDInternalH;
SVideoInitialize g_VideoInitialize;
PLUGIN_GLOBALS* globals;
Renderer *g_renderer;
bool s_bLastFrameDumped = false;

View File

@ -31,7 +31,6 @@
#include "VideoCommon.h"
#include "Thread.h"
#include "MathUtil.h"
#include "pluginspecs_video.h"
#include "NativeVertexFormat.h"
#include "FramebufferManagerBase.h"
#include "BPMemory.h"
@ -43,8 +42,6 @@ extern int frameCount;
extern int OSDChoice, OSDTime;
extern bool s_bLastFrameDumped;
extern SVideoInitialize g_VideoInitialize;
extern PLUGIN_GLOBALS* globals;
// Renderer really isn't a very good name for this class - it's more like "Misc".
// The long term goal is to get rid of this class and replace it with others that make
@ -132,6 +129,17 @@ public:
static unsigned int GetPrevPixelFormat() { return prev_efb_format; }
static void StorePixelFormat(unsigned int new_format) { prev_efb_format = new_format; }
// TODO: doesn't belong here
virtual void SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4) = 0;
virtual void SetPSConstant4fv(unsigned int const_number, const float *f) = 0;
virtual void SetMultiPSConstant4fv(unsigned int const_number, unsigned int count, const float *f) = 0;
// TODO: doesn't belong here
virtual void SetVSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4) = 0;
virtual void SetVSConstant4fv(unsigned int const_number, const float *f) = 0;
virtual void SetMultiVSConstant3fv(unsigned int const_number, unsigned int count, const float *f) = 0;
virtual void SetMultiVSConstant4fv(unsigned int const_number, unsigned int count, const float *f) = 0;
protected:
static Common::CriticalSection s_criticalScreenshot;

View File

@ -11,6 +11,8 @@
#include "TextureCacheBase.h"
#include "Debugger.h"
#include "ConfigManager.h"
#include "HW/Memmap.h"
// ugly
extern int frameCount;
@ -33,20 +35,17 @@ TextureCache::TCacheEntryBase::~TCacheEntryBase()
if (!isRenderTarget && !g_ActiveConfig.bSafeTextureCache)
{
u32 *const ptr = (u32*)g_VideoInitialize.pGetMemoryPointer(addr);
u32 *const ptr = (u32*)Memory::GetPointer(addr);
if (ptr && *ptr == hash)
*ptr = oldpixel;
}
}
// TODO: uglyness
extern PLUGIN_GLOBALS *globals;
TextureCache::TextureCache()
{
temp = (u8*)AllocateMemoryPages(TEMP_SIZE);
TexDecoder_SetTexFmtOverlayOptions(g_ActiveConfig.bTexFmtOverlayEnable, g_ActiveConfig.bTexFmtOverlayCenter);
HiresTextures::Init(globals->unique_id);
HiresTextures::Init(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
}
void TextureCache::Invalidate(bool shutdown)
@ -164,7 +163,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage,
if (0 == address)
return NULL;
u8* ptr = g_VideoInitialize.pGetMemoryPointer(address);
u8* ptr = Memory::GetPointer(address);
// TexelSizeInNibbles(format)*width*height/16;
const unsigned int bsw = TexDecoder_GetBlockWidthInTexels(texformat) - 1;
@ -288,7 +287,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage,
unsigned int newWidth = width;
unsigned int newHeight = height;
sprintf(texPathTemp, "%s_%08llx_%i", globals->unique_id, texHash, texformat);
sprintf(texPathTemp, "%s_%08llx_%i", SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str(), texHash, texformat);
pcfmt = HiresTextures::GetHiresTex(texPathTemp, &newWidth, &newHeight, texformat, temp);
if (pcfmt != PC_TEX_FMT_NONE)
@ -385,11 +384,11 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage,
char szDir[MAX_PATH];
// make sure that the directory exists
sprintf(szDir, "%s%s", File::GetUserPath(D_DUMPTEXTURES_IDX), globals->unique_id);
sprintf(szDir, "%s%s", File::GetUserPath(D_DUMPTEXTURES_IDX), SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
if (false == File::Exists(szDir) || false == File::IsDirectory(szDir))
File::CreateDir(szDir);
sprintf(szTemp, "%s/%s_%08llx_%i.png", szDir, globals->unique_id, texHash, texformat);
sprintf(szTemp, "%s/%s_%08llx_%i.png", szDir, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str(), texHash, texformat);
if (false == File::Exists(szTemp))
entry->Save(szTemp);

View File

@ -25,6 +25,7 @@
#include "PixelShaderManager.h"
#include "PixelShaderGen.h"
#include "BPMemory.h"
#include "RenderBase.h"
#define WRITE p+=sprintf
@ -874,8 +875,8 @@ const char *GenerateEncodingShader(u32 format,API_TYPE ApiType)
void SetShaderParameters(float width, float height, float offsetX, float offsetY, float widthStride, float heightStride,float buffW,float buffH)
{
SetPSConstant4f(C_COLORMATRIX, widthStride, heightStride, buffW, buffH);
SetPSConstant4f(C_COLORMATRIX + 1, width, (height - 1), offsetX, offsetY);
g_renderer->SetPSConstant4f(C_COLORMATRIX, widthStride, heightStride, buffW, buffH);
g_renderer->SetPSConstant4f(C_COLORMATRIX + 1, width, (height - 1), offsetX, offsetY);
}
} // namespace

View File

@ -25,6 +25,7 @@
#include "x64Emitter.h"
#include "ABI.h"
#include "PixelEngine.h"
#include "Host.h"
#include "LookUpTables.h"
#include "Statistics.h"
@ -302,7 +303,7 @@ void VertexLoader::CompileVertexTranslator()
{
char temp[256];
sprintf(temp,"%i %i %i %i", m_VtxDesc.Normal, m_VtxAttr.NormalFormat, m_VtxAttr.NormalElements, m_VtxAttr.NormalIndex3);
g_VideoInitialize.pSysMessage("VertexLoader_Normal::GetFunction returned zero!");
Host_SysMessage("VertexLoader_Normal::GetFunction returned zero!");
}
WriteCall(pFunc);

View File

@ -32,6 +32,7 @@ using __gnu_cxx::hash_map;
#include "VertexShaderManager.h"
#include "VertexLoader.h"
#include "VertexLoaderManager.h"
#include "HW/Memmap.h"
static int s_attr_dirty; // bitfield
@ -204,7 +205,7 @@ void LoadCPReg(u32 sub_cmd, u32 value)
// Pointers to vertex arrays in GC RAM
case 0xA0:
arraybases[sub_cmd & 0xF] = value;
cached_arraybases[sub_cmd & 0xF] = Memory_GetPtr(value);
cached_arraybases[sub_cmd & 0xF] = Memory::GetPointer(value);
break;
case 0xB0:
@ -217,6 +218,6 @@ void RecomputeCachedArraybases()
{
for (int i = 0; i < 16; i++)
{
cached_arraybases[i] = Memory_GetPtr(arraybases[i]);
cached_arraybases[i] = Memory::GetPointer(arraybases[i]);
}
}

View File

@ -32,6 +32,8 @@
#include "VideoCommon.h"
#include "VertexManagerBase.h"
#include "RenderBase.h"
static float GC_ALIGNED16(s_fMaterials[16]);
float GC_ALIGNED16(g_fProjectionMatrix[16]);
@ -50,6 +52,26 @@ static float s_fViewRotation[2];
void UpdateViewport();
inline void SetVSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4)
{
g_renderer->SetVSConstant4f(const_number, f1, f2, f3, f4);
}
inline void SetVSConstant4fv(unsigned int const_number, const float *f)
{
g_renderer->SetVSConstant4fv(const_number, f);
}
inline void SetMultiVSConstant3fv(unsigned int const_number, unsigned int count, const float *f)
{
g_renderer->SetMultiVSConstant3fv(const_number, count, f);
}
inline void SetMultiVSConstant4fv(unsigned int const_number, unsigned int count, const float *f)
{
g_renderer->SetMultiVSConstant4fv(const_number, count, f);
}
namespace
{
// Control Variables

View File

@ -55,10 +55,4 @@ public:
static void ResetView();
};
void SetVSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4);
void SetVSConstant4fv(unsigned int const_number, const float *f);
void SetMultiVSConstant3fv(unsigned int const_number, unsigned int count, const float *f);
void SetMultiVSConstant4fv(unsigned int const_number, unsigned int count, const float *f);
#endif // _VERTEXSHADERMANAGER_H

View File

@ -20,7 +20,7 @@
#include "Common.h"
#include "MathUtil.h"
#include "pluginspecs_video.h"
#include "VideoBackendBase.h"
#if defined(_MSC_VER) && !defined(__x86_64__) && !defined(_M_X64)
void * memcpy_amd(void *dest, const void *src, size_t n);
@ -57,44 +57,6 @@ enum
// Do testing to figure out if the speed hit is bad?
// #define BBOX_SUPPORT
extern SVideoInitialize g_VideoInitialize;
inline u8 *Memory_GetPtr(u32 _uAddress)
{
return g_VideoInitialize.pGetMemoryPointer(_uAddress);
}
inline u8 Memory_Read_U8(u32 _uAddress)
{
return *(u8*)g_VideoInitialize.pGetMemoryPointer(_uAddress);
}
inline u16 Memory_Read_U16(u32 _uAddress)
{
return Common::swap16(*(u16*)g_VideoInitialize.pGetMemoryPointer(_uAddress));
}
inline u32 Memory_Read_U32(u32 _uAddress)
{
return Common::swap32(*(u32*)g_VideoInitialize.pGetMemoryPointer(_uAddress));
}
inline u8* Memory_Read_U8_Ptr(u32 _uAddress)
{
return (u8*)g_VideoInitialize.pGetMemoryPointer(_uAddress);
}
inline u16* Memory_Read_U16_Unswapped_Ptr(u32 _uAddress)
{
return (u16*)g_VideoInitialize.pGetMemoryPointer(_uAddress);
}
inline u32* Memory_Read_U32_Unswapped_Ptr(u32 _uAddress)
{
return (u32*)g_VideoInitialize.pGetMemoryPointer(_uAddress);
}
// Logging
// ----------
void HandleGLError();

View File

@ -243,6 +243,9 @@ void VideoConfig::Save(const char *ini_file)
iniFile.Save(ini_file);
}
// TODO: remove
extern bool g_aspect_wide;
// TODO: Figure out a better place for this function.
void ComputeDrawRectangle(int backbuffer_width, int backbuffer_height, bool flip, TargetRectangle *rc)
{
@ -257,7 +260,7 @@ void ComputeDrawRectangle(int backbuffer_width, int backbuffer_height, bool flip
// Handle aspect ratio.
// Default to auto.
bool use16_9 = g_VideoInitialize.bAutoAspectIs16_9;
bool use16_9 = g_aspect_wide;
// Update aspect ratio hack values
// Won't take effect until next frame

View File

@ -22,6 +22,7 @@
#include "VertexManagerBase.h"
#include "VertexShaderManager.h"
#include "PixelShaderManager.h"
#include "HW/Memmap.h"
// LoadXFReg 0x10
void LoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData)
@ -224,5 +225,5 @@ void LoadIndexedXF(u32 val, int array)
//PRIM_LOG("xfmem iwrite: 0x%x-0x%x\n", address, address+size);
for (int i = 0; i < size; i++)
xfmem[address + i] = Memory_Read_U32(arraybases[array] + arraystrides[array] * index + i * 4);
xfmem[address + i] = Memory::Read_U32(arraybases[array] + arraystrides[array] * index + i * 4);
}

View File

@ -127,7 +127,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\Common\Src;..\..\PluginSpecs;..\..\..\Externals\SOIL;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\Common\Src;..\Core\Src;..\..\PluginSpecs;..\..\..\Externals\SOIL;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
@ -142,7 +142,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\Common\Src;..\..\PluginSpecs;..\..\..\Externals\SOIL;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\Common\Src;..\Core\Src;..\..\PluginSpecs;..\..\..\Externals\SOIL;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
@ -159,7 +159,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\Common\Src;..\..\PluginSpecs;..\..\..\Externals\SOIL;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\Common\Src;..\Core\Src;..\..\PluginSpecs;..\..\..\Externals\SOIL;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
@ -178,7 +178,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\Common\Src;..\..\PluginSpecs;..\..\..\Externals\SOIL;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\Common\Src;..\Core\Src;..\..\PluginSpecs;..\..\..\Externals\SOIL;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DEBUGFAST;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
@ -197,7 +197,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\Common\Src;..\..\PluginSpecs;..\..\..\Externals\SOIL;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\Common\Src;..\Core\Src;..\..\PluginSpecs;..\..\..\Externals\SOIL;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
@ -216,7 +216,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\Common\Src;..\..\PluginSpecs;..\..\..\Externals\SOIL;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\Common\Src;..\Core\Src;..\..\PluginSpecs;..\..\..\Externals\SOIL;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DEBUGFAST;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
@ -350,4 +350,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -19,6 +19,7 @@
#include "IniFile.h"
#include "DebuggerPanel.h"
#include "FileUtil.h"
#include "../../Core/Src/ConfigManager.h"
#include "VideoConfig.h"
#include "TextureCacheBase.h"
@ -26,8 +27,6 @@
#include "VertexShaderGen.h"
#include "NativeVertexFormat.h"
extern PLUGIN_GLOBALS* globals;
BEGIN_EVENT_TABLE(GFXDebuggerPanel, wxPanel)
EVT_CLOSE(GFXDebuggerPanel::OnClose)
EVT_BUTTON(ID_PAUSE,GFXDebuggerPanel::OnPauseButton)
@ -249,7 +248,7 @@ void GFXDebuggerPanel::OnPauseAtNextFrameButton(wxCommandEvent& event)
void GFXDebuggerPanel::OnDumpButton(wxCommandEvent& event)
{
char dump_path[MAX_PATH];
sprintf(dump_path, "%sDebug/%s/", File::GetUserPath(D_DUMP_IDX), globals->unique_id);
sprintf(dump_path, "%sDebug/%s/", File::GetUserPath(D_DUMP_IDX), SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
if (!File::CreateFullPath(dump_path))
return;

View File

@ -14,7 +14,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Core", "Core\Core\Core.vcpr
{B7F1A9FB-BEA8-416E-9460-AE35A6A5165C} = {B7F1A9FB-BEA8-416E-9460-AE35A6A5165C}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_VideoDX9", "Plugins\Plugin_VideoDX9\Plugin_VideoDX9.vcproj", "{636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VideoDX9", "Plugins\Plugin_VideoDX9\Plugin_VideoDX9.vcproj", "{636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18}"
ProjectSection(ProjectDependencies) = postProject
{11F55366-12EC-4C44-A8CB-1D4E315D61ED} = {11F55366-12EC-4C44-A8CB-1D4E315D61ED}
{56C4B06E-F2C9-4729-A15A-DD327A9AA465} = {56C4B06E-F2C9-4729-A15A-DD327A9AA465}
@ -42,7 +42,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DiscIO", "Core\DiscIO\DiscI
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
EndProjectSection
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}") = "VideoOGL", "Plugins\Plugin_VideoOGL\Plugin_VideoOGL.vcproj", "{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}"
ProjectSection(ProjectDependencies) = postProject
{C7E5D50A-2916-464B-86A7-E10B3CC88ADA} = {C7E5D50A-2916-464B-86A7-E10B3CC88ADA}
{05C75041-D67D-4903-A362-8395A7B35C75} = {05C75041-D67D-4903-A362-8395A7B35C75}
@ -63,9 +63,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "Core\Common\Commo
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Dolphin", "Core\DolphinWX\DolphinWX.vcproj", "{A72606EF-C5C1-4954-90AD-F0F93A8D97D9}"
ProjectSection(ProjectDependencies) = postProject
{21DBE606-2958-43AC-A14E-B6B798D56554} = {21DBE606-2958-43AC-A14E-B6B798D56554}
{C7E5D50A-2916-464B-86A7-E10B3CC88ADA} = {C7E5D50A-2916-464B-86A7-E10B3CC88ADA}
{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160} = {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}
{D4833C30-FA5F-4DFE-BD32-109DE1F09ED1} = {D4833C30-FA5F-4DFE-BD32-109DE1F09ED1}
{05C75041-D67D-4903-A362-8395A7B35C75} = {05C75041-D67D-4903-A362-8395A7B35C75}
{636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18} = {636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18}
{33546D62-7F34-4EA6-A88E-D538B36E16BF} = {33546D62-7F34-4EA6-A88E-D538B36E16BF}
{11F55366-12EC-4C44-A8CB-1D4E315D61ED} = {11F55366-12EC-4C44-A8CB-1D4E315D61ED}
{FBAFB369-07EB-4460-9CAD-08BE5789DAB6} = {FBAFB369-07EB-4460-9CAD-08BE5789DAB6}
@ -182,7 +185,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxCore28", "..\Externals\wx
{B807E8DB-4241-4754-BC2A-2F435BCA881A} = {B807E8DB-4241-4754-BC2A-2F435BCA881A}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_VideoSoftware", "Plugins\Plugin_VideoSoftware\Plugin_VideoSoftware.vcproj", "{66A4E7BD-E2E8-4373-9B75-8750EB5AE683}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VideoSoftware", "Plugins\Plugin_VideoSoftware\Plugin_VideoSoftware.vcproj", "{66A4E7BD-E2E8-4373-9B75-8750EB5AE683}"
ProjectSection(ProjectDependencies) = postProject
{11F55366-12EC-4C44-A8CB-1D4E315D61ED} = {11F55366-12EC-4C44-A8CB-1D4E315D61ED}
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA} = {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}
@ -191,7 +194,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_VideoSoftware", "Plu
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_VideoDX11", "Plugins\Plugin_VideoDX11\Plugin_VideoDX11.vcproj", "{21DBE606-2958-43AC-A14E-B6B798D56554}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VideoDX11", "Plugins\Plugin_VideoDX11\Plugin_VideoDX11.vcproj", "{21DBE606-2958-43AC-A14E-B6B798D56554}"
ProjectSection(ProjectDependencies) = postProject
{11F55366-12EC-4C44-A8CB-1D4E315D61ED} = {11F55366-12EC-4C44-A8CB-1D4E315D61ED}
{56C4B06E-F2C9-4729-A15A-DD327A9AA465} = {56C4B06E-F2C9-4729-A15A-DD327A9AA465}
@ -582,9 +585,9 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
AMDCaProjectFile = G:\Dolphin\Source\CodeAnalyst\Dolphin.caw
AMDCaPersistentStartup = Dolphin
AMDCaPersistentConfig = Release|x64
AMDCaPersistentStartup = Dolphin
AMDCaProjectFile = G:\Dolphin\Source\CodeAnalyst\Dolphin.caw
EndGlobalSection
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}

View File

@ -91,7 +91,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DiscIO", "Core\DiscIO\DiscI
{C87A4178-44F6-49B2-B7AA-C79AF1B8C534} = {C87A4178-44F6-49B2-B7AA-C79AF1B8C534}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_VideoDX9", "Plugins\Plugin_VideoDX9\Plugin_VideoDX9.vcxproj", "{DC7D7AF4-CE47-49E8-8B63-265CB6233A49}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VideoDX9", "Plugins\Plugin_VideoDX9\Plugin_VideoDX9.vcxproj", "{DC7D7AF4-CE47-49E8-8B63-265CB6233A49}"
ProjectSection(ProjectDependencies) = postProject
{281F6001-D032-4C3B-87AF-0B00962B4006} = {281F6001-D032-4C3B-87AF-0B00962B4006}
{3E5C4E02-1BA9-4776-BDBE-E3F91FFA34CF} = {3E5C4E02-1BA9-4776-BDBE-E3F91FFA34CF}
@ -118,24 +118,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_VideoSoftware", "Plu
{3E5C4E02-1BA9-4776-BDBE-E3F91FFA34CF} = {3E5C4E02-1BA9-4776-BDBE-E3F91FFA34CF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_DSP_HLE", "Plugins\Plugin_DSP_HLE\Plugin_DSP_HLE.vcxproj", "{27980B4B-F26C-41E8-9C44-A3D4F259D6E7}"
ProjectSection(ProjectDependencies) = postProject
{11F55366-12EC-4C44-A8CB-1D4E315D61ED} = {11F55366-12EC-4C44-A8CB-1D4E315D61ED}
{0E231FB1-F3C9-4724-ACCB-DE8BCB3C089E} = {0E231FB1-F3C9-4724-ACCB-DE8BCB3C089E}
{37D007BD-D66C-4EAF-B56C-BD1AAC340A05} = {37D007BD-D66C-4EAF-B56C-BD1AAC340A05}
{1C8436C9-DBAF-42BE-83BC-CF3EC9175ABE} = {1C8436C9-DBAF-42BE-83BC-CF3EC9175ABE}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_DSP_LLE", "Plugins\Plugin_DSP_LLE\Plugin_DSP_LLE.vcxproj", "{14BF7DCF-8078-4FB4-B1E8-CDAC61271DFC}"
ProjectSection(ProjectDependencies) = postProject
{C5A30052-1FC7-4A30-B4A2-6B06DA298AB3} = {C5A30052-1FC7-4A30-B4A2-6B06DA298AB3}
{11F55366-12EC-4C44-A8CB-1D4E315D61ED} = {11F55366-12EC-4C44-A8CB-1D4E315D61ED}
{0E231FB1-F3C9-4724-ACCB-DE8BCB3C089E} = {0E231FB1-F3C9-4724-ACCB-DE8BCB3C089E}
{37D007BD-D66C-4EAF-B56C-BD1AAC340A05} = {37D007BD-D66C-4EAF-B56C-BD1AAC340A05}
{4ED3C8BE-91A7-4361-8D46-16D03B678D4C} = {4ED3C8BE-91A7-4361-8D46-16D03B678D4C}
{1C8436C9-DBAF-42BE-83BC-CF3EC9175ABE} = {1C8436C9-DBAF-42BE-83BC-CF3EC9175ABE}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InputCommon", "Core\InputCommon\InputCommon.vcxproj", "{B39AC394-5DB5-4DA9-9D98-09D46CA3701F}"
ProjectSection(ProjectDependencies) = postProject
{C87A4178-44F6-49B2-B7AA-C79AF1B8C534} = {C87A4178-44F6-49B2-B7AA-C79AF1B8C534}
@ -456,28 +438,6 @@ Global
{9E9DA440-E9AD-413C-B648-91030E792211}.Release|Win32.Build.0 = Release|Win32
{9E9DA440-E9AD-413C-B648-91030E792211}.Release|x64.ActiveCfg = Release|x64
{9E9DA440-E9AD-413C-B648-91030E792211}.Release|x64.Build.0 = Release|x64
{27980B4B-F26C-41E8-9C44-A3D4F259D6E7}.Debug|Win32.ActiveCfg = Debug|Win32
{27980B4B-F26C-41E8-9C44-A3D4F259D6E7}.Debug|Win32.Build.0 = Debug|Win32
{27980B4B-F26C-41E8-9C44-A3D4F259D6E7}.Debug|x64.ActiveCfg = Debug|Win32
{27980B4B-F26C-41E8-9C44-A3D4F259D6E7}.DebugFast|Win32.ActiveCfg = Release|Win32
{27980B4B-F26C-41E8-9C44-A3D4F259D6E7}.DebugFast|Win32.Build.0 = Release|Win32
{27980B4B-F26C-41E8-9C44-A3D4F259D6E7}.DebugFast|x64.ActiveCfg = DebugFast|x64
{27980B4B-F26C-41E8-9C44-A3D4F259D6E7}.DebugFast|x64.Build.0 = DebugFast|x64
{27980B4B-F26C-41E8-9C44-A3D4F259D6E7}.Release|Win32.ActiveCfg = Release|Win32
{27980B4B-F26C-41E8-9C44-A3D4F259D6E7}.Release|Win32.Build.0 = Release|Win32
{27980B4B-F26C-41E8-9C44-A3D4F259D6E7}.Release|x64.ActiveCfg = Release|x64
{27980B4B-F26C-41E8-9C44-A3D4F259D6E7}.Release|x64.Build.0 = Release|x64
{14BF7DCF-8078-4FB4-B1E8-CDAC61271DFC}.Debug|Win32.ActiveCfg = Debug|Win32
{14BF7DCF-8078-4FB4-B1E8-CDAC61271DFC}.Debug|Win32.Build.0 = Debug|Win32
{14BF7DCF-8078-4FB4-B1E8-CDAC61271DFC}.Debug|x64.ActiveCfg = Debug|Win32
{14BF7DCF-8078-4FB4-B1E8-CDAC61271DFC}.DebugFast|Win32.ActiveCfg = Release|Win32
{14BF7DCF-8078-4FB4-B1E8-CDAC61271DFC}.DebugFast|Win32.Build.0 = Release|Win32
{14BF7DCF-8078-4FB4-B1E8-CDAC61271DFC}.DebugFast|x64.ActiveCfg = DebugFast|x64
{14BF7DCF-8078-4FB4-B1E8-CDAC61271DFC}.DebugFast|x64.Build.0 = DebugFast|x64
{14BF7DCF-8078-4FB4-B1E8-CDAC61271DFC}.Release|Win32.ActiveCfg = Release|Win32
{14BF7DCF-8078-4FB4-B1E8-CDAC61271DFC}.Release|Win32.Build.0 = Release|Win32
{14BF7DCF-8078-4FB4-B1E8-CDAC61271DFC}.Release|x64.ActiveCfg = Release|x64
{14BF7DCF-8078-4FB4-B1E8-CDAC61271DFC}.Release|x64.Build.0 = Release|x64
{B39AC394-5DB5-4DA9-9D98-09D46CA3701F}.Debug|Win32.ActiveCfg = Debug|Win32
{B39AC394-5DB5-4DA9-9D98-09D46CA3701F}.Debug|Win32.Build.0 = Debug|Win32
{B39AC394-5DB5-4DA9-9D98-09D46CA3701F}.Debug|x64.ActiveCfg = Debug|x64

View File

@ -1,6 +0,0 @@
#undef EXPORT
#undef CALL
#if defined(__cplusplus)
}
#endif

View File

@ -1,15 +0,0 @@
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#define CALL __cdecl
#else
#define EXPORT __attribute__ ((visibility("default")))
#define CALL
#endif
#if defined(__cplusplus)
extern "C" {
#endif

View File

@ -9,7 +9,8 @@
// ------------
// TODO: See if we can get rid of the windows.h include.
#ifdef _WIN32
#include <windows.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#include "Common.h"
#include "CommonTypes.h"
@ -31,135 +32,28 @@ enum PLUGIN_COMM
// System specific declarations and definitions
// ------------
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#define CALL __cdecl
#else
#define EXPORT __attribute__ ((visibility("default")))
#define __cdecl
#define CALL
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
// TODO: get rid of this i think
#if !defined(_WIN32) && !defined(TRUE)
#define TRUE 1
#define FALSE 0
#endif
#if defined(__cplusplus)
extern "C" {
#endif
// Global values
// ------------
// Plugin types
enum PLUGIN_TYPE {
PLUGIN_TYPE_VIDEO = 1,
};
#define STATE_MODE_READ 1
#define STATE_MODE_WRITE 2
#define STATE_MODE_MEASURE 3
//enum STATE_MODE
//{
// STATE_MODE_READ = 1,
// STATE_MODE_WRITE,
// STATE_MODE_MEASURE,
//};
// used for notification on emulation state
enum PLUGIN_EMUSTATE {
enum PLUGIN_EMUSTATE
{
PLUGIN_EMUSTATE_PLAY = 1,
PLUGIN_EMUSTATE_PAUSE,
PLUGIN_EMUSTATE_STOP,
};
// Export structs
// ------------
typedef struct
{
u16 Version; // Set to 0x0100
PLUGIN_TYPE Type; // Set to PLUGIN_TYPE_DVD
char Name[100]; // Name of the DLL
} PLUGIN_INFO;
// TODO: Remove, or at least remove the void pointers and replace with data.
// This design is just wrong and ugly - the plugins shouldn't have this much access.
typedef struct
{
void *was_eventHandler_but_lets_not_break_abi;
void *logManager;
char game_ini[MAX_PATH];
char unique_id[16];
} PLUGIN_GLOBALS;
// GLOBAL I N T E R F A C E
// ____________________________________________________________________________
// Function: GetDllInfo
// Purpose: This function allows the emulator to gather information
// about the DLL by filling in the PluginInfo structure.
// input: A pointer to a PLUGIN_INFO structure that needs to be
// filled by the function. (see def above)
// output: none
//
EXPORT void CALL GetDllInfo(PLUGIN_INFO* _pPluginInfo);
// ___________________________________________________________________________
// Function: DllConfig
// Purpose: This function is optional function that is provided
// to allow the user to configure the DLL
// input: A handle to the window that calls this function
// output: none
//
EXPORT void CALL DllConfig(void *_hParent);
// ___________________________________________________________________________
// Function: DllDebugger
// Purpose: Open the debugger
// input: a handle to the window that calls this function
// output: none
//
EXPORT void* CALL DllDebugger(void *_hParent, bool Show);
// ___________________________________________________________________________
// Function: DllSetGlobals
// Purpose: Set the pointer for globals variables
// input: a pointer to the global struct
// output: none
//
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);
// ___________________________________________________________________________
// Function: EmuStateChange
// Purpose: Notifies the plugin of a change in emulation state
// input: newState
// output: none
//
EXPORT void CALL EmuStateChange(PLUGIN_EMUSTATE newState);
#if defined(__cplusplus)
}
#endif
#endif // _PLUGINS_H_INCLUDED__

View File

@ -1,208 +0,0 @@
//__________________________________________________________________________________________________
// Common video plugin spec, version #1.0 maintained by F|RES
//
#ifndef _VIDEO_H_INCLUDED__
#define _VIDEO_H_INCLUDED__
#include "PluginSpecs.h"
#include "ExportProlog.h"
typedef void (*TimedCallback)(u64 userdata, int cyclesLate);
typedef void (*TSetInterrupt)(u32 _causemask, bool _bSet);
typedef int (*TRegisterEvent)(const char *name, TimedCallback callback);
typedef void (*TScheduleEvent_Threadsafe)(int cyclesIntoFuture, int event_type, u64 userdata);
typedef void (*TRemoveEvent)(int event_type);
typedef void (*TProcessFifoEvents)(void);
typedef unsigned char* (*TGetMemoryPointer)(const unsigned int _iAddress);
typedef void (*TVideoLog)(const char* _pMessage, int _bBreak);
typedef void (*TSysMessage)(const char *fmt, ...);
typedef void (*TGetWindowSize)(int& x, int& y, int& width, int& height);
typedef void (*TRequestWindowSize)(int& width, int& height);
typedef void (*TCopiedToXFB)(bool video_update);
typedef unsigned int (*TPeekMessages)(void);
typedef void (*TUpdateFPSDisplay)(const char* text); // sets the window title
typedef void (*TCoreMessage)(int Id); // passes message to the core
typedef void (*TResetGatherPipe)(void);
enum FieldType
{
FIELD_PROGRESSIVE = 0,
FIELD_UPPER,
FIELD_LOWER
};
enum EFBAccessType
{
PEEK_Z = 0,
POKE_Z,
PEEK_COLOR,
POKE_COLOR
};
typedef struct
{
// 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
} SCPFifoStruct;
typedef struct
{
void *pWindowHandle;
TSetInterrupt pSetInterrupt;
TRegisterEvent pRegisterEvent;
TScheduleEvent_Threadsafe pScheduleEvent_Threadsafe;
TRemoveEvent pRemoveEvent;
TProcessFifoEvents pProcessFifoEvents;
TGetMemoryPointer pGetMemoryPointer;
TVideoLog pLog;
TSysMessage pSysMessage;
TGetWindowSize pGetWindowSize;
TRequestWindowSize pRequestWindowSize;
TCopiedToXFB pCopiedToXFB;
TPeekMessages pPeekMessages;
TUpdateFPSDisplay pUpdateFPSDisplay;
TCoreMessage pCoreMessage;
TResetGatherPipe pResetGatherPipe;
void *pMemoryBase;
bool bWii;
bool bOnThread;
u32 *Fifo_CPUBase;
u32 *Fifo_CPUEnd;
u32 *Fifo_CPUWritePointer;
bool bAutoAspectIs16_9;
} SVideoInitialize;
// I N T E R F A C E
// __________________________________________________________________________________________________
// Function: Video_Prepare
// Purpose: This function is called from the EmuThread before the
// emulation has started. It is just for threadsensitive
// APIs like OpenGL.
// input: none
// output: none
//
EXPORT void CALL Video_Prepare(void);
// __________________________________________________________________________________________________
// Function: Video_BeginField
// Purpose: When a field begins in the VI emulator, this function tells the video plugin what the
// parameters of the upcoming field are. The video plugin should make sure the previous
// field is on the player's display before returning.
// input: vi parameters of the upcoming field
// output: none
//
EXPORT void CALL Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight);
// __________________________________________________________________________________________________
// Function: Video_EndField
// Purpose: When a field ends in the VI emulator, this function notifies the video plugin. The video
// has permission to swap the field to the player's display.
// input: none
// output: none
//
EXPORT void CALL Video_EndField();
// __________________________________________________________________________________________________
// Function: Video_AccessEFB
// input: type of access (r/w, z/color, ...), x coord, y coord
// output: response to the access request (ex: peek z data at specified coord)
//
EXPORT u32 CALL Video_AccessEFB(EFBAccessType type, u32 x, u32 y,u32 InputData);
// __________________________________________________________________________________________________
// Function: Video_Screenshot
// input: Filename
// output: TRUE if all was okay
//
EXPORT void CALL Video_Screenshot(const char *_szFilename);
// __________________________________________________________________________________________________
// Function: Video_EnterLoop
// Purpose: Enters the video fifo dispatch loop. This is only used in Dual Core mode.
// input: none
// output: none
//
EXPORT void CALL Video_EnterLoop(void);
// __________________________________________________________________________________________________
// Function: Video_ExitLoop
// Purpose: Exits the video dispatch loop. This is only used in Dual Core mode.
// input: none
// output: none
//
EXPORT void CALL Video_ExitLoop(void);
// __________________________________________________________________________________________________
// Function: Video_SetRendering
// Purpose: Sets video rendering on and off. Currently used for frame skipping
// input: Enabled toggle
// output: none
//
EXPORT void CALL Video_SetRendering(bool bEnabled);
// __________________________________________________________________________________________________
// Function: Video_AddMessage
// Purpose: Adds a message to the display queue, to be shown forthe specified time
// input: pointer to the null-terminated string, time in milliseconds
// output: none
//
EXPORT void CALL Video_AddMessage(const char* pstr, unsigned int milliseconds);
EXPORT void CALL Video_CommandProcessorRead16(u16& _rReturnValue, const u32 _Address);
EXPORT void CALL Video_CommandProcessorWrite16(const u16 _Data, const u32 _Address);
EXPORT void CALL Video_PixelEngineRead16(u16& _rReturnValue, const u32 _Address);
EXPORT void CALL Video_PixelEngineWrite16(const u16 _Data, const u32 _Address);
EXPORT void CALL Video_PixelEngineWrite32(const u32 _Data, const u32 _Address);
EXPORT void CALL Video_GatherPipeBursted(void);
EXPORT void CALL Video_WaitForFrameFinish(void);
// __________________________________________________________________________________________________
// Function: Video_IsFifoBusy
// Purpose: Return if the FIFO is proecessing data, that is used for sync gfx thread and emulator
// thread in CoreTiming
// input: none
// output: bool
//
EXPORT bool CALL Video_IsFifoBusy(void);
EXPORT void CALL Video_AbortFrame(void);
#include "ExportEpilog.h"
#endif

View File

@ -2,7 +2,7 @@
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="Plugin_VideoDX11"
Name="VideoDX11"
ProjectGUID="{21DBE606-2958-43AC-A14E-B6B798D56554}"
RootNamespace="Plugin_VideoDX11"
TargetFrameworkVersion="196613"
@ -22,7 +22,7 @@
Name="Release|Win32"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
@ -58,7 +58,7 @@
FavorSizeOrSpeed="1"
OmitFramePointers="false"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/Core/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="_WIN32;WIN32;NDEBUG;_WINDOWS;_USRDLL;VIDEO_DIRECTX11_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
StringPooling="true"
RuntimeLibrary="0"
@ -89,26 +89,11 @@
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="&quot;..\..\core\common\win32\release\common.lib&quot;"
AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib dxguid.lib winmm.lib vfw32.lib wxbase28u.lib wxmsw28u_core.lib"
OutputFile="..\..\..\Binary\Win32\Plugins\Plugin_VideoDX11.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="../../../Externals/Cg;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;"
GenerateManifest="false"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib"
TargetMachine="1"
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
@ -118,9 +103,6 @@
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -129,7 +111,7 @@
Name="Release|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
@ -166,7 +148,7 @@
FavorSizeOrSpeed="1"
OmitFramePointers="false"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/Core/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;VIDEO_DIRECTX11_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
StringPooling="true"
ExceptionHandling="1"
@ -198,27 +180,11 @@
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib dxguid.lib winmm.lib vfw32.lib wxbase28u.lib wxmsw28u_core.lib"
OutputFile="..\..\..\Binary\x64\Plugins\Plugin_VideoDX11.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\Externals\Cg64;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;"
GenerateManifest="false"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib"
TargetMachine="17"
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
@ -228,9 +194,6 @@
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -239,7 +202,7 @@
Name="Debug|Win32"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
@ -269,7 +232,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/Core/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="_WIN32;WIN32;_DEBUG;_WINDOWS;_USRDLL;VIDEO_DIRECTX11_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -295,27 +258,11 @@
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="&quot;..\..\core\common\win32\debug\common.lib&quot;"
AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib uuid.lib dxguid.lib Rpcrt4.lib winmm.lib vfw32.lib wxbase28ud.lib wxmsw28ud_core.lib"
OutputFile="..\..\..\Binary\Win32/Plugins\Plugin_VideoDX11D.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="../../../Externals/Cg;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;"
GenerateManifest="false"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib"
TargetMachine="1"
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
@ -325,9 +272,6 @@
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -336,7 +280,7 @@
Name="Debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
@ -366,7 +310,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/Core/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;VIDEO_DIRECTX11_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -392,26 +336,11 @@
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib uuid.lib dxguid.lib Rpcrt4.lib winmm.lib vfw32.lib"
OutputFile="..\..\..\Binary\x64\Plugins\Plugin_VideoDX11D.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\Externals\Cg64;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;"
GenerateManifest="false"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib"
TargetMachine="17"
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
@ -421,9 +350,6 @@
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -432,7 +358,7 @@
Name="DebugFast|Win32"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
@ -468,7 +394,7 @@
FavorSizeOrSpeed="1"
OmitFramePointers="false"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/Core/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="_WIN32;WIN32;NDEBUG;_WINDOWS;_USRDLL;VIDEO_DIRECTX11_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;DEBUGFAST"
StringPooling="true"
RuntimeLibrary="0"
@ -498,27 +424,11 @@
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib uuid.lib dxguid.lib Rpcrt4.lib winmm.lib vfw32.lib"
OutputFile="..\..\..\Binary\Win32\Plugins\Plugin_VideoDX11DF.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="../../../Externals/Cg;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;"
GenerateManifest="false"
IgnoreDefaultLibraryNames=""
GenerateDebugInformation="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib"
TargetMachine="1"
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
@ -528,9 +438,6 @@
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -539,7 +446,7 @@
Name="DebugFast|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
@ -576,7 +483,7 @@
FavorSizeOrSpeed="1"
OmitFramePointers="false"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/Core/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;VIDEO_DIRECTX11_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;;DEBUGFAST"
StringPooling="true"
ExceptionHandling="1"
@ -607,26 +514,11 @@
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib uuid.lib dxguid.lib Rpcrt4.lib winmm.lib vfw32.lib"
OutputFile="..\..\..\Binary\x64\Plugins\Plugin_VideoDX11DF.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\Externals\Cg64;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;"
GenerateManifest="false"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib"
TargetMachine="17"
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
@ -636,9 +528,6 @@
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>

View File

@ -29,38 +29,39 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{9A4C733C-BADE-4AC6-B58A-6E274395E90E}</ProjectGuid>
<RootNamespace>Plugin_VideoDX11</RootNamespace>
<ProjectName>VideoDX11</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
@ -131,7 +132,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\Core\Core\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
@ -147,7 +148,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\Core\Core\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
@ -165,7 +166,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\Core\Core\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
@ -205,7 +206,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\Core\Core\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
@ -287,6 +288,7 @@
<ClInclude Include="Src\TextureCache.h" />
<ClInclude Include="Src\VertexManager.h" />
<ClInclude Include="Src\VertexShaderCache.h" />
<ClInclude Include="Src\VideoBackend.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -23,9 +23,5 @@
#include "main.h"
#include "VideoCommon.h"
#include "pluginspecs_video.h"
// A global plugin specification
extern PLUGIN_GLOBALS* globals;
#endif // _GLOBALS_H_

View File

@ -22,6 +22,9 @@
#include "VertexManager.h"
#include "VertexShaderCache.h"
namespace DX11
{
class D3DVertexFormat : public NativeVertexFormat
{
D3D11_INPUT_ELEMENT_DESC m_elems[32];
@ -38,16 +41,11 @@ public:
void SetupVertexPointers();
};
namespace DX11
{
NativeVertexFormat* VertexManager::CreateNativeVertexFormat()
{
return new D3DVertexFormat();
}
}
DXGI_FORMAT VarToD3D(VarType t, int size)
{
DXGI_FORMAT retval = DXGI_FORMAT_UNKNOWN;
@ -155,3 +153,5 @@ void D3DVertexFormat::SetupVertexPointers()
}
DX11::D3D::context->IASetInputLayout(m_layout);
}
} // namespace DX11

View File

@ -28,6 +28,8 @@
#include "PixelShaderGen.h"
#include "PixelShaderCache.h"
#include "ConfigManager.h"
extern int frameCount;
// See comment near the bottom of this file.
@ -37,7 +39,6 @@ bool pscbufchanged = true;
namespace DX11
{
PixelShaderCache::PSCache PixelShaderCache::PixelShaders;
const PixelShaderCache::PSCacheEntry* PixelShaderCache::last_entry;
@ -271,7 +272,7 @@ void PixelShaderCache::Init()
SETSTAT(stats.numPixelShadersAlive, 0);
char cache_filename[MAX_PATH];
sprintf(cache_filename, "%sdx11-%s-ps.cache", File::GetUserPath(D_SHADERCACHE_IDX), globals->unique_id);
sprintf(cache_filename, "%sdx11-%s-ps.cache", File::GetUserPath(D_SHADERCACHE_IDX), SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
PixelShaderCacheInserter inserter;
g_ps_disk_cache.OpenAndRead(cache_filename, inserter);
}
@ -386,9 +387,6 @@ bool PixelShaderCache::InsertByteCode(const PIXELSHADERUID &uid, const void* byt
return true;
}
} // DX11
// These are "callbacks" from VideoCommon and thus must be outside namespace DX11.
// This will have to be changed when we merge.
@ -414,7 +412,7 @@ static const unsigned int ps_constant_offset_table[] = {
260, 264, 268, 272, 276, // C_PLIGHTS7, 20
280, 284, 288, 292 // C_PMATERIALS, 16
};
void SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4)
void Renderer::SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4)
{
psconstants[ps_constant_offset_table[const_number] ] = f1;
psconstants[ps_constant_offset_table[const_number]+1] = f2;
@ -423,14 +421,16 @@ void SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, fl
pscbufchanged = true;
}
void SetPSConstant4fv(unsigned int const_number, const float* f)
void Renderer::SetPSConstant4fv(unsigned int const_number, const float* f)
{
memcpy(&psconstants[ps_constant_offset_table[const_number]], f, sizeof(float)*4);
pscbufchanged = true;
}
void SetMultiPSConstant4fv(unsigned int const_number, unsigned int count, const float* f)
void Renderer::SetMultiPSConstant4fv(unsigned int const_number, unsigned int count, const float* f)
{
memcpy(&psconstants[ps_constant_offset_table[const_number]], f, sizeof(float)*4*count);
pscbufchanged = true;
}
} // DX11

View File

@ -24,7 +24,8 @@
class PIXELSHADERUID;
enum DSTALPHA_MODE;
namespace DX11 {
namespace DX11
{
class PixelShaderCache
{
@ -61,4 +62,4 @@ private:
static const PSCacheEntry* last_entry;
};
} // namespace DX11
} // namespace DX11

View File

@ -38,7 +38,7 @@
#include "Render.h"
#include "TextureCache.h"
#include "VertexShaderCache.h"
#include "Core.h"
namespace DX11
{
@ -313,7 +313,7 @@ Renderer::Renderer()
int x, y, w_temp, h_temp;
s_blendMode = 0;
g_VideoInitialize.pGetWindowSize(x, y, w_temp, h_temp);
Core::Callback_VideoGetWindowSize(x, y, w_temp, h_temp);
D3D::Create(EmuWindow::GetWnd());
@ -447,7 +447,7 @@ void Renderer::SetWindowSize(int width, int height)
// Scale the window size by the EFB scale.
CalculateTargetScale(width, height, width, height);
g_VideoInitialize.pRequestWindowSize(width, height);
Core::Callback_VideoRequestWindowSize(width, height);
}
bool Renderer::SetScissorRect()
@ -897,7 +897,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
{
if (g_bSkipCurrentFrame || (!XFBWrited && (!g_ActiveConfig.bUseXFB || !g_ActiveConfig.bUseRealXFB)) || !fbWidth || !fbHeight)
{
g_VideoInitialize.pCopiedToXFB(false);
Core::Callback_VideoCopiedToXFB(false);
return;
}
// this function is called after the XFB field is changed, not after
@ -909,7 +909,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
const XFBSourceBase* const* xfbSourceList = FramebufferManager::GetXFBSource(xfbAddr, fbWidth, fbHeight, xfbCount);
if ((!xfbSourceList || xfbCount == 0) && g_ActiveConfig.bUseXFB && !g_ActiveConfig.bUseRealXFB)
{
g_VideoInitialize.pCopiedToXFB(false);
Core::Callback_VideoCopiedToXFB(false);
return;
}
@ -1120,7 +1120,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
UpdateViewport();
VertexShaderManager::SetViewportChanged();
g_VideoInitialize.pCopiedToXFB(XFBWrited || (g_ActiveConfig.bUseXFB && g_ActiveConfig.bUseRealXFB));
Core::Callback_VideoCopiedToXFB(XFBWrited || (g_ActiveConfig.bUseXFB && g_ActiveConfig.bUseRealXFB));
XFBWrited = false;
}

View File

@ -49,6 +49,15 @@ public:
static bool CheckForResize();
static void SetWindowSize(int width, int height);
void SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4);
void SetPSConstant4fv(unsigned int const_number, const float *f);
void SetMultiPSConstant4fv(unsigned int const_number, unsigned int count, const float *f);
void SetVSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4);
void SetVSConstant4fv(unsigned int const_number, const float *f);
void SetMultiVSConstant3fv(unsigned int const_number, unsigned int count, const float *f);
void SetMultiVSConstant4fv(unsigned int const_number, unsigned int count, const float *f);
};
}

View File

@ -26,6 +26,8 @@
#include "Globals.h"
#include "VertexShaderCache.h"
#include "ConfigManager.h"
// See comment near the bottom of this file
static unsigned int vs_constant_offset_table[C_VENVCONST_END];
float vsconstants[C_VENVCONST_END*4];
@ -168,7 +170,7 @@ void VertexShaderCache::Init()
SETSTAT(stats.numVertexShadersAlive, 0);
char cache_filename[MAX_PATH];
sprintf(cache_filename, "%sdx11-%s-vs.cache", File::GetUserPath(D_SHADERCACHE_IDX), globals->unique_id);
sprintf(cache_filename, "%sdx11-%s-vs.cache", File::GetUserPath(D_SHADERCACHE_IDX), SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
VertexShaderCacheInserter inserter;
g_vs_disk_cache.OpenAndRead(cache_filename, inserter);
}
@ -264,13 +266,11 @@ bool VertexShaderCache::InsertByteCode(const VERTEXSHADERUID &uid, D3DBlob* bcod
return true;
}
} // namespace DX11
// These are "callbacks" from VideoCommon and thus must be outside namespace DX11.
// This will have to be changed when we merge.
// maps the constant numbers to float indices in the constant buffer
void SetVSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4)
void Renderer::SetVSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4)
{
vsconstants[vs_constant_offset_table[const_number] ] = f1;
vsconstants[vs_constant_offset_table[const_number]+1] = f2;
@ -279,13 +279,13 @@ void SetVSConstant4f(unsigned int const_number, float f1, float f2, float f3, fl
vscbufchanged = true;
}
void SetVSConstant4fv(unsigned int const_number, const float* f)
void Renderer::SetVSConstant4fv(unsigned int const_number, const float* f)
{
memcpy(&vsconstants[vs_constant_offset_table[const_number]], f, sizeof(float)*4);
vscbufchanged = true;
}
void SetMultiVSConstant3fv(unsigned int const_number, unsigned int count, const float* f)
void Renderer::SetMultiVSConstant3fv(unsigned int const_number, unsigned int count, const float* f)
{
for (unsigned int i = 0; i < count; i++)
{
@ -295,8 +295,10 @@ void SetMultiVSConstant3fv(unsigned int const_number, unsigned int count, const
vscbufchanged = true;
}
void SetMultiVSConstant4fv(unsigned int const_number, unsigned int count, const float* f)
void Renderer::SetMultiVSConstant4fv(unsigned int const_number, unsigned int count, const float* f)
{
memcpy(&vsconstants[vs_constant_offset_table[const_number]], f, sizeof(float)*4*count);
vscbufchanged = true;
}
}
} // namespace DX11

View File

@ -0,0 +1,27 @@
#ifndef DX11_VIDEO_BACKEND_H_
#define DX11_VIDEO_BACKEND_H_
#include "VideoBackendBase.h"
namespace DX11
{
class VideoBackend : public VideoBackendHLE
{
void Initialize();
void Shutdown();
std::string GetName();
void Video_Prepare();
void ShowConfig(void* parent);
void UpdateFPSDisplay(const char*);
unsigned int PeekMessages();
};
}
#endif

View File

@ -30,6 +30,7 @@
#include "VertexLoaderManager.h"
#include "VertexShaderManager.h"
#include "XFBConvert.h"
#include "Core.h"
#include "DebuggerPanel.h"
#include "DLCache.h"
@ -46,83 +47,18 @@
#include "VertexManager.h"
#include "VertexShaderCache.h"
#include "VideoBackend.h"
#include "ConfigManager.h"
HINSTANCE g_hInstance = NULL;
wxLocale *InitLanguageSupport()
namespace DX11
{
wxLocale *m_locale;
unsigned int language = 0;
IniFile ini;
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
ini.Get("Interface", "Language", &language, wxLANGUAGE_DEFAULT);
// Load language if possible, fall back to system default otherwise
if(wxLocale::IsAvailable(language))
{
m_locale = new wxLocale(language);
m_locale->AddCatalogLookupPathPrefix(wxT("Languages"));
m_locale->AddCatalog(wxT("dolphin-emu"));
if(!m_locale->IsOk())
{
PanicAlertT("Error loading selected language. Falling back to system default.");
delete m_locale;
m_locale = new wxLocale(wxLANGUAGE_DEFAULT);
}
}
else
{
PanicAlertT("The selected language is not supported by your system. Falling back to system default.");
m_locale = new wxLocale(wxLANGUAGE_DEFAULT);
}
return m_locale;
void*& VideoWindowHandle()
{
return SConfig::GetInstance().m_LocalCoreStartupParameter.hMainWindow;
}
// This is used for the functions right below here which use wxwidgets
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
void *DllDebugger(void *_hParent, bool Show)
{
return new GFXDebuggerPanel((wxWindow*)_hParent);
}
class wxDLLApp : public wxApp
{
bool OnInit()
{
return true;
}
};
IMPLEMENT_APP_NO_MAIN(wxDLLApp)
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
{
static wxLocale *m_locale;
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
{
wxSetInstance((HINSTANCE)hinstDLL);
wxInitialize();
m_locale = InitLanguageSupport();
}
break;
case DLL_PROCESS_DETACH:
wxUninitialize();
delete m_locale;
break;
}
g_hInstance = hinstDLL;
return TRUE;
}
unsigned int Callback_PeekMessages()
unsigned int VideoBackend::PeekMessages()
{
MSG msg;
while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
@ -135,31 +71,29 @@ unsigned int Callback_PeekMessages()
return TRUE;
}
void UpdateFPSDisplay(const char *text)
void VideoBackend::UpdateFPSDisplay(const char *text)
{
char temp[512];
sprintf_s(temp, sizeof temp, "%s | DX11 | %s", svn_rev_str, text);
SetWindowTextA(EmuWindow::GetWnd(), temp);
}
void GetDllInfo(PLUGIN_INFO* _PluginInfo)
{
_PluginInfo->Version = 0x0100;
_PluginInfo->Type = PLUGIN_TYPE_VIDEO;
#ifdef DEBUGFAST
sprintf_s(_PluginInfo->Name, 100, "Dolphin Direct3D11 (DebugFast)");
#elif defined _DEBUG
sprintf_s(_PluginInfo->Name, 100, "Dolphin Direct3D11 (Debug)");
#else
sprintf_s(_PluginInfo->Name, 100, "Dolphin Direct3D11");
#endif
}
//void GetDllInfo(PLUGIN_INFO* _PluginInfo)
//{
// _PluginInfo->Version = 0x0100;
// //_PluginInfo->Type = PLUGIN_TYPE_VIDEO;
//#ifdef DEBUGFAST
// sprintf_s(_PluginInfo->Name, 100, "Dolphin Direct3D11 (DebugFast)");
//#elif defined _DEBUG
// sprintf_s(_PluginInfo->Name, 100, "Dolphin Direct3D11 (Debug)");
//#else
// sprintf_s(_PluginInfo->Name, 100, "Dolphin Direct3D11");
//#endif
//}
void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
std::string VideoBackend::GetName()
{
globals = _pPluginGlobals;
LogManager::SetInstance((LogManager*)globals->logManager);
return "Direct3D11";
}
void InitBackendInfo()
@ -175,7 +109,7 @@ void InitBackendInfo()
g_Config.backend_info.bSupportsPixelLighting = true;
}
void DllConfig(void *_hParent)
void VideoBackend::ShowConfig(void *_hParent)
{
#if defined(HAVE_WX) && HAVE_WX
InitBackendInfo();
@ -234,42 +168,30 @@ void DllConfig(void *_hParent)
#endif
}
void Initialize(void *init)
void VideoBackend::Initialize()
{
InitBackendInfo();
frameCount = 0;
SVideoInitialize *_pVideoInitialize = (SVideoInitialize*)init;
// Create a shortcut to _pVideoInitialize that can also update it
g_VideoInitialize = *(_pVideoInitialize);
InitXFBConvTables();
g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx11.ini").c_str());
g_Config.GameIniLoad(globals->game_ini);
g_Config.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
UpdateProjectionHack(g_Config.iPhackvalue, g_Config.sPhackvalue);
UpdateActiveConfig();
g_VideoInitialize.pWindowHandle = (void*)EmuWindow::Create((HWND)g_VideoInitialize.pWindowHandle, g_hInstance, _T("Loading - Please wait."));
if (g_VideoInitialize.pWindowHandle == NULL)
VideoWindowHandle() = (void*)EmuWindow::Create((HWND)VideoWindowHandle(), GetModuleHandle(0), _T("Loading - Please wait."));
if (VideoWindowHandle() == NULL)
{
ERROR_LOG(VIDEO, "An error has occurred while trying to create the window.");
return;
}
g_VideoInitialize.pPeekMessages = &Callback_PeekMessages;
g_VideoInitialize.pUpdateFPSDisplay = &UpdateFPSDisplay;
_pVideoInitialize->pPeekMessages = g_VideoInitialize.pPeekMessages;
_pVideoInitialize->pUpdateFPSDisplay = g_VideoInitialize.pUpdateFPSDisplay;
// Now the window handle is written
_pVideoInitialize->pWindowHandle = g_VideoInitialize.pWindowHandle;
OSD::AddMessage("Dolphin Direct3D11 Video Plugin.", 5000);
s_PluginInitialized = true;
}
void Video_Prepare()
void VideoBackend::Video_Prepare()
{
// Better be safe...
s_efbAccessRequested = FALSE;
@ -277,12 +199,12 @@ void Video_Prepare()
s_swapRequested = FALSE;
// internal interfaces
g_renderer = new DX11::Renderer;
g_texture_cache = new DX11::TextureCache;
g_vertex_manager = new DX11::VertexManager;
DX11::VertexShaderCache::Init();
DX11::PixelShaderCache::Init();
DX11::D3D::InitUtils();
g_renderer = new Renderer;
g_texture_cache = new TextureCache;
g_vertex_manager = new VertexManager;
VertexShaderCache::Init();
PixelShaderCache::Init();
D3D::InitUtils();
// VideoCommon
BPInit();
@ -296,10 +218,10 @@ void Video_Prepare()
DLCache::Init();
// Tell the host that the window is ready
g_VideoInitialize.pCoreMessage(WM_USER_CREATE);
Core::Callback_CoreMessage(WM_USER_CREATE);
}
void Shutdown()
void VideoBackend::Shutdown()
{
s_PluginInitialized = false;
@ -317,9 +239,9 @@ void Shutdown()
VertexLoaderManager::Shutdown();
// internal interfaces
DX11::D3D::ShutdownUtils();
DX11::PixelShaderCache::Shutdown();
DX11::VertexShaderCache::Shutdown();
D3D::ShutdownUtils();
PixelShaderCache::Shutdown();
VertexShaderCache::Shutdown();
delete g_vertex_manager;
delete g_texture_cache;
delete g_renderer;
@ -327,3 +249,5 @@ void Shutdown()
s_PluginInitialized = false;
}
}

View File

@ -18,10 +18,7 @@
#ifndef MAIN_H
#define MAIN_H
#include "PluginSpecs_Video.h"
#include "Render.h"
#include "MainBase.h"
extern SVideoInitialize g_VideoInitialize;
#endif

View File

@ -2,7 +2,7 @@
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="Plugin_VideoDX9"
Name="VideoDX9"
ProjectGUID="{636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18}"
RootNamespace="Plugin_VideoDX9"
TargetFrameworkVersion="131072"
@ -22,7 +22,7 @@
Name="Release|Win32"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
@ -58,7 +58,7 @@
FavorSizeOrSpeed="1"
OmitFramePointers="false"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/Core/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="_WIN32;WIN32;NDEBUG;_WINDOWS;_USRDLL;VIDEO_DIRECTX9_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
StringPooling="true"
RuntimeLibrary="0"
@ -91,26 +91,11 @@
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="&quot;..\..\core\common\win32\release\common.lib&quot;"
AdditionalDependencies="comctl32.lib winmm.lib vfw32.lib wxbase28u.lib wxmsw28u_core.lib"
OutputFile="..\..\..\Binary\Win32\Plugins\Plugin_VideoDX9.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="../../../Externals/Cg;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;"
GenerateManifest="false"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib"
TargetMachine="1"
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
@ -120,9 +105,6 @@
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -131,7 +113,7 @@
Name="Release|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
@ -168,7 +150,7 @@
FavorSizeOrSpeed="1"
OmitFramePointers="false"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/Core/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;VIDEO_DIRECTX9_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
StringPooling="true"
ExceptionHandling="1"
@ -202,27 +184,11 @@
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="comctl32.lib winmm.lib vfw32.lib rpcrt4.lib wxbase28u.lib wxmsw28u_core.lib"
OutputFile="..\..\..\Binary\x64\Plugins\Plugin_VideoDX9.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\Externals\Cg64;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;"
GenerateManifest="false"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib"
TargetMachine="17"
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
@ -232,9 +198,6 @@
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -243,7 +206,7 @@
Name="Debug|Win32"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
@ -273,7 +236,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/Core/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="_WIN32;WIN32;_DEBUG;_WINDOWS;_USRDLL;VIDEO_DIRECTX9_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -301,27 +264,11 @@
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="&quot;..\..\core\common\win32\debug\common.lib&quot;"
AdditionalDependencies="comctl32.lib winmm.lib vfw32.lib rpcrt4.lib wxbase28ud.lib wxmsw28ud_core.lib"
OutputFile="..\..\..\Binary\Win32/Plugins\Plugin_VideoDX9D.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="../../../Externals/Cg;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;"
GenerateManifest="false"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib"
TargetMachine="1"
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
@ -331,9 +278,6 @@
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -342,7 +286,7 @@
Name="Debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
@ -372,7 +316,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/Core/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;VIDEO_DIRECTX9_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -400,26 +344,11 @@
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="comctl32.lib winmm.lib vfw32.lib rpcrt4.lib wxbase28ud.lib wxmsw28ud_core.lib"
OutputFile="..\..\..\Binary\x64\Plugins\Plugin_VideoDX9D.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\Externals\Cg64;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;"
GenerateManifest="false"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib"
TargetMachine="17"
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
@ -429,9 +358,6 @@
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -440,7 +366,7 @@
Name="DebugFast|Win32"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
@ -476,7 +402,7 @@
FavorSizeOrSpeed="1"
OmitFramePointers="false"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/Core/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="_WIN32;WIN32;NDEBUG;_WINDOWS;_USRDLL;VIDEO_DIRECTX9_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;DEBUGFAST"
StringPooling="true"
RuntimeLibrary="0"
@ -508,27 +434,11 @@
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="comctl32.lib winmm.lib vfw32.lib wxbase28u.lib wxmsw28u_core.lib"
OutputFile="..\..\..\Binary\Win32\Plugins\Plugin_VideoDX9DF.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="../../../Externals/Cg;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;"
GenerateManifest="false"
IgnoreDefaultLibraryNames=""
GenerateDebugInformation="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib"
TargetMachine="1"
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
@ -538,9 +448,6 @@
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -549,7 +456,7 @@
Name="DebugFast|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
@ -586,7 +493,7 @@
FavorSizeOrSpeed="1"
OmitFramePointers="false"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
AdditionalIncludeDirectories="../../../Externals;../../PluginSpecs;../../Core/Common/Src;../../Core/Core/Src;../../Core/VideoCommon/Src;../../Core/VideoUICommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;VIDEO_DIRECTX9_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;;DEBUGFAST"
StringPooling="true"
ExceptionHandling="1"
@ -619,26 +526,11 @@
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="comctl32.lib winmm.lib vfw32.lib rpcrt4.lib wxbase28u.lib wxmsw28u_core.lib"
OutputFile="..\..\..\Binary\x64\Plugins\Plugin_VideoDX9DF.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\Externals\Cg64;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;"
GenerateManifest="false"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib"
TargetMachine="17"
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
@ -648,9 +540,6 @@
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>

View File

@ -29,38 +29,39 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{DC7D7AF4-CE47-49E8-8B63-265CB6233A49}</ProjectGuid>
<RootNamespace>Plugin_VideoDX9</RootNamespace>
<ProjectName>VideoDX9</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
@ -131,7 +132,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\Core\Core\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
@ -146,7 +147,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\Core\Core\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
@ -163,7 +164,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\Core\Core\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
@ -182,7 +183,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\Core\Core\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DEBUGFAST;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
@ -201,7 +202,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\Core\Core\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
@ -220,7 +221,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\Core\Common\Src;..\..\Core\Core\Src;..\..\PluginSpecs;..\..\Core\VideoCommon\Src;..\..\Core\VideoUICommon\Src;..\..\..\Externals\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DEBUGFAST;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
@ -279,6 +280,7 @@
<ClInclude Include="Src\TextureConverter.h" />
<ClInclude Include="Src\VertexManager.h" />
<ClInclude Include="Src\VertexShaderCache.h" />
<ClInclude Include="Src\VideoBackend.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -22,6 +22,7 @@
#include "PixelShaderCache.h"
#include "VertexShaderCache.h"
#include "TextureConverter.h"
#include "HW/Memmap.h"
namespace DX9
{
@ -176,7 +177,7 @@ void XFBSource::DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight)
void FramebufferManager::CopyToRealXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc,float Gamma)
{
u8* xfb_in_ram = Memory_GetPtr(xfbAddr);
u8* xfb_in_ram = Memory::GetPointer(xfbAddr);
if (!xfb_in_ram)
{
WARN_LOG(VIDEO, "Tried to copy to invalid XFB address");

View File

@ -23,9 +23,5 @@
#include "main.h"
#include "VideoCommon.h"
#include "pluginspecs_video.h"
// A global plugin specification
extern PLUGIN_GLOBALS* globals;
#endif // _GLOBALS_H_

View File

@ -27,6 +27,9 @@
#include "NativeVertexFormat.h"
#include "VertexManager.h"
namespace DX9
{
class D3DVertexFormat : public NativeVertexFormat
{
LPDIRECT3DVERTEXDECLARATION9 d3d_decl;
@ -43,16 +46,11 @@ public:
#endif
};
namespace DX9
{
NativeVertexFormat* VertexManager::CreateNativeVertexFormat()
{
return new D3DVertexFormat();
}
}
void DX9::VertexManager::GetElements(NativeVertexFormat* format, D3DVERTEXELEMENT9** elems, int* num)
{
#if defined(_DEBUG) || defined(DEBUGFAST)
@ -191,3 +189,5 @@ void D3DVertexFormat::SetupVertexPointers()
else
ERROR_LOG(VIDEO, "invalid d3d decl");
}
} // namespace DX9

View File

@ -36,6 +36,7 @@
#include "XFMemory.h"
#include "ImageWrite.h"
#include "Debugger.h"
#include "ConfigManager.h"
namespace DX9
{
@ -274,7 +275,7 @@ void PixelShaderCache::Init()
SETSTAT(stats.numPixelShadersAlive, 0);
char cache_filename[MAX_PATH];
sprintf(cache_filename, "%sdx9-%s-ps.cache", File::GetUserPath(D_SHADERCACHE_IDX), globals->unique_id);
sprintf(cache_filename, "%sdx9-%s-ps.cache", File::GetUserPath(D_SHADERCACHE_IDX), SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
PixelShaderCacheInserter inserter;
g_ps_disk_cache.OpenAndRead(cache_filename, inserter);
}
@ -418,21 +419,20 @@ bool PixelShaderCache::InsertByteCode(const PIXELSHADERUID &uid, const u8 *bytec
return true;
}
} // namespace DX9
void SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4)
void Renderer::SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4)
{
float f[4] = { f1, f2, f3, f4 };
DX9::D3D::dev->SetPixelShaderConstantF(const_number, f, 1);
}
void SetPSConstant4fv(unsigned int const_number, const float *f)
void Renderer::SetPSConstant4fv(unsigned int const_number, const float *f)
{
DX9::D3D::dev->SetPixelShaderConstantF(const_number, f, 1);
}
void SetMultiPSConstant4fv(unsigned int const_number, unsigned int count, const float *f)
void Renderer::SetMultiPSConstant4fv(unsigned int const_number, unsigned int count, const float *f)
{
DX9::D3D::dev->SetPixelShaderConstantF(const_number, f, count);
}
} // namespace DX9

View File

@ -50,6 +50,7 @@
#include "TextureConverter.h"
#include "DLCache.h"
#include "Debugger.h"
#include "Core.h"
namespace DX9
{
@ -256,7 +257,7 @@ Renderer::Renderer()
// Multisample Anti-aliasing hasn't been implemented yet use supersamling instead
int backbuffer_ms_mode = 0;
g_VideoInitialize.pGetWindowSize(x, y, w_temp, h_temp);
Core::Callback_VideoGetWindowSize(x, y, w_temp, h_temp);
for (fullScreenRes = 0; fullScreenRes < (int)D3D::GetAdapter(g_ActiveConfig.iAdapter).resolutions.size(); fullScreenRes++)
{
@ -433,7 +434,7 @@ void Renderer::SetWindowSize(int width, int height)
// Scale the window size by the EFB scale.
CalculateTargetScale(width, height, width, height);
g_VideoInitialize.pRequestWindowSize(width, height);
Core::Callback_VideoRequestWindowSize(width, height);
}
bool Renderer::SetScissorRect()
@ -920,7 +921,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
{
if (g_bSkipCurrentFrame || (!XFBWrited && (!g_ActiveConfig.bUseXFB || !g_ActiveConfig.bUseRealXFB)) || !fbWidth || !fbHeight)
{
g_VideoInitialize.pCopiedToXFB(false);
Core::Callback_VideoCopiedToXFB(false);
return;
}
// this function is called after the XFB field is changed, not after
@ -932,7 +933,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
const XFBSourceBase* const* xfbSourceList = FramebufferManager::GetXFBSource(xfbAddr, fbWidth, fbHeight, xfbCount);
if ((!xfbSourceList || xfbCount == 0) && g_ActiveConfig.bUseXFB && !g_ActiveConfig.bUseRealXFB)
{
g_VideoInitialize.pCopiedToXFB(false);
Core::Callback_VideoCopiedToXFB(false);
return;
}
@ -1256,7 +1257,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
// Renderer::SetZBufferRender();
// SaveTexture("tex.tga", GL_TEXTURE_RECTANGLE_ARB, s_FakeZTarget,
// GetTargetWidth(), GetTargetHeight());
g_VideoInitialize.pCopiedToXFB(XFBWrited || (g_ActiveConfig.bUseXFB && g_ActiveConfig.bUseRealXFB));
Core::Callback_VideoCopiedToXFB(XFBWrited || (g_ActiveConfig.bUseXFB && g_ActiveConfig.bUseRealXFB));
XFBWrited = false;
}

View File

@ -48,6 +48,15 @@ public:
static bool CheckForResize();
static void SetWindowSize(int width, int height);
void SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4);
void SetPSConstant4fv(unsigned int const_number, const float *f);
void SetMultiPSConstant4fv(unsigned int const_number, unsigned int count, const float *f);
void SetVSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4);
void SetVSConstant4fv(unsigned int const_number, const float *f);
void SetMultiVSConstant3fv(unsigned int const_number, unsigned int count, const float *f);
void SetMultiVSConstant4fv(unsigned int const_number, unsigned int count, const float *f);
};
} // namespace DX9

View File

@ -31,6 +31,7 @@
#include "TextureCache.h"
#include "Math.h"
#include "FileUtil.h"
#include "HW/Memmap.h"
namespace DX9
{
@ -339,7 +340,7 @@ void EncodeToRam(u32 address, bool bFromZBuffer, bool bIsIntensityFmt, u32 copyf
if (!texconv_shader)
return;
u8 *dest_ptr = Memory_GetPtr(address);
u8 *dest_ptr = Memory::GetPointer(address);
LPDIRECT3DTEXTURE9 source_texture = bFromZBuffer ? FramebufferManager::GetEFBDepthTexture() : FramebufferManager::GetEFBColorTexture();
int width = (source.right - source.left) >> bScaleByHalf;
@ -408,7 +409,7 @@ u64 EncodeToRamFromTexture(u32 address,LPDIRECT3DTEXTURE9 source_texture, u32 So
if (!texconv_shader)
return 0;
u8 *dest_ptr = Memory_GetPtr(address);
u8 *dest_ptr = Memory::GetPointer(address);
int width = (source.right - source.left) >> bScaleByHalf;
int height = (source.bottom - source.top) >> bScaleByHalf;
@ -480,7 +481,7 @@ void EncodeToRamYUYV(LPDIRECT3DTEXTURE9 srcTexture, const TargetRectangle& sourc
// Should be scale free.
void DecodeToTexture(u32 xfbAddr, int srcWidth, int srcHeight, LPDIRECT3DTEXTURE9 destTexture)
{
u8* srcAddr = Memory_GetPtr(xfbAddr);
u8* srcAddr = Memory::GetPointer(xfbAddr);
if (!srcAddr)
{
WARN_LOG(VIDEO, "Tried to decode from invalid memory address");

View File

@ -31,6 +31,7 @@
#include "BPMemory.h"
#include "XFMemory.h"
#include "Debugger.h"
#include "ConfigManager.h"
namespace DX9
{
@ -146,7 +147,7 @@ void VertexShaderCache::Init()
SETSTAT(stats.numVertexShadersAlive, 0);
char cache_filename[MAX_PATH];
sprintf(cache_filename, "%sdx9-%s-vs.cache", File::GetUserPath(D_SHADERCACHE_IDX), globals->unique_id);
sprintf(cache_filename, "%sdx9-%s-vs.cache", File::GetUserPath(D_SHADERCACHE_IDX), SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
VertexShaderCacheInserter inserter;
g_vs_disk_cache.OpenAndRead(cache_filename, inserter);
}
@ -246,21 +247,18 @@ bool VertexShaderCache::InsertByteCode(const VERTEXSHADERUID &uid, const u8 *byt
return false;
}
} // namespace DX9
void SetVSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4)
void Renderer::SetVSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4)
{
const float f[4] = { f1, f2, f3, f4 };
DX9::D3D::dev->SetVertexShaderConstantF(const_number, f, 1);
}
void SetVSConstant4fv(unsigned int const_number, const float *f)
void Renderer::SetVSConstant4fv(unsigned int const_number, const float *f)
{
DX9::D3D::dev->SetVertexShaderConstantF(const_number, f, 1);
}
void SetMultiVSConstant3fv(unsigned int const_number, unsigned int count, const float *f)
void Renderer::SetMultiVSConstant3fv(unsigned int const_number, unsigned int count, const float *f)
{
float buf[4*C_VENVCONST_END];
for (unsigned int i = 0; i < count; i++)
@ -273,7 +271,9 @@ void SetMultiVSConstant3fv(unsigned int const_number, unsigned int count, const
DX9::D3D::dev->SetVertexShaderConstantF(const_number, buf, count);
}
void SetMultiVSConstant4fv(unsigned int const_number, unsigned int count, const float *f)
void Renderer::SetMultiVSConstant4fv(unsigned int const_number, unsigned int count, const float *f)
{
DX9::D3D::dev->SetVertexShaderConstantF(const_number, f, count);
}
} // namespace DX9

View File

@ -0,0 +1,27 @@
#ifndef DX9_VIDEO_BACKEND_H_
#define DX9_VIDEO_BACKEND_H_
#include "VideoBackendBase.h"
namespace DX9
{
class VideoBackend : public VideoBackendHLE
{
void Initialize();
void Shutdown();
std::string GetName();
void Video_Prepare();
void ShowConfig(void* parent);
void UpdateFPSDisplay(const char*);
unsigned int PeekMessages();
};
}
#endif

View File

@ -53,84 +53,20 @@
#include "render.h"
#include "DLCache.h"
#include "IniFile.h"
#include "Core.h"
HINSTANCE g_hInstance = NULL;
#include "ConfigManager.h"
#include "VideoBackend.h"
wxLocale *InitLanguageSupport()
namespace DX9
{
wxLocale *m_locale;
unsigned int language = 0;
IniFile ini;
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
ini.Get("Interface", "Language", &language, wxLANGUAGE_DEFAULT);
// Load language if possible, fall back to system default otherwise
if(wxLocale::IsAvailable(language))
{
m_locale = new wxLocale(language);
m_locale->AddCatalogLookupPathPrefix(wxT("Languages"));
m_locale->AddCatalog(wxT("dolphin-emu"));
if(!m_locale->IsOk())
{
PanicAlertT("Error loading selected language. Falling back to system default.");
delete m_locale;
m_locale = new wxLocale(wxLANGUAGE_DEFAULT);
}
}
else
{
PanicAlertT("The selected language is not supported by your system. Falling back to system default.");
m_locale = new wxLocale(wxLANGUAGE_DEFAULT);
}
return m_locale;
void*& VideoWindowHandle()
{
return SConfig::GetInstance().m_LocalCoreStartupParameter.hMainWindow;
}
// This is used for the functions right below here which use wxwidgets
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
void *DllDebugger(void *_hParent, bool Show)
{
return new GFXDebuggerPanel((wxWindow*)_hParent);
}
class wxDLLApp : public wxApp
{
bool OnInit()
{
return true;
}
};
IMPLEMENT_APP_NO_MAIN(wxDLLApp)
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
{
static wxLocale *m_locale;
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
{
wxSetInstance((HINSTANCE)hinstDLL);
wxInitialize();
m_locale = InitLanguageSupport();
}
break;
case DLL_PROCESS_DETACH:
wxUninitialize();
delete m_locale;
break;
}
g_hInstance = hinstDLL;
return TRUE;
}
unsigned int Callback_PeekMessages()
unsigned int VideoBackend::PeekMessages()
{
MSG msg;
while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
@ -143,36 +79,29 @@ unsigned int Callback_PeekMessages()
return TRUE;
}
void UpdateFPSDisplay(const char *text)
void VideoBackend::UpdateFPSDisplay(const char *text)
{
TCHAR temp[512];
swprintf_s(temp, sizeof(temp)/sizeof(TCHAR), _T("%hs | DX9 | %hs"), svn_rev_str, text);
SetWindowText(EmuWindow::GetWnd(), temp);
}
void GetDllInfo(PLUGIN_INFO* _PluginInfo)
{
_PluginInfo->Version = 0x0100;
_PluginInfo->Type = PLUGIN_TYPE_VIDEO;
#ifdef DEBUGFAST
sprintf_s(_PluginInfo->Name, 100, "Dolphin Direct3D9 (DebugFast)");
#elif defined _DEBUG
sprintf_s(_PluginInfo->Name, 100, "Dolphin Direct3D9 (Debug)");
#else
sprintf_s(_PluginInfo->Name, 100, "Dolphin Direct3D9");
#endif
}
//void GetDllInfo(PLUGIN_INFO* _PluginInfo)
//{
// _PluginInfo->Version = 0x0100;
// //_PluginInfo->Type = PLUGIN_TYPE_VIDEO;
//#ifdef DEBUGFAST
// sprintf_s(_PluginInfo->Name, 100, "Dolphin Direct3D9 (DebugFast)");
//#elif defined _DEBUG
// sprintf_s(_PluginInfo->Name, 100, "Dolphin Direct3D9 (Debug)");
//#else
// sprintf_s(_PluginInfo->Name, 100, "Dolphin Direct3D9");
//#endif
//}
void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
std::string VideoBackend::GetName()
{
globals = _pPluginGlobals;
LogManager::SetInstance((LogManager*)globals->logManager);
}
void DllAbout(HWND _hParent)
{
//DialogBox(g_hInstance,(LPCTSTR)IDD_ABOUT,_hParent,(DLGPROC)AboutProc);
return "Direct3D9";
}
void InitBackendInfo()
@ -190,7 +119,7 @@ void InitBackendInfo()
g_Config.backend_info.bSupportsPixelLighting = C_PLIGHTS + 40 <= maxConstants && C_PMATERIALS + 4 <= maxConstants;
}
void DllConfig(void *_hParent)
void VideoBackend::ShowConfig(void* parent)
{
#if defined(HAVE_WX) && HAVE_WX
InitBackendInfo();
@ -212,7 +141,7 @@ void DllConfig(void *_hParent)
}
VideoConfigDiag *const diag = new VideoConfigDiag((wxWindow*)_hParent, _trans("Direct3D9"), "gfx_dx9");
VideoConfigDiag *const diag = new VideoConfigDiag((wxWindow*)parent, _trans("Direct3D9"), "gfx_dx9");
diag->ShowModal();
diag->Destroy();
@ -220,23 +149,20 @@ void DllConfig(void *_hParent)
#endif
}
void Initialize(void *init)
void VideoBackend::Initialize()
{
InitBackendInfo();
frameCount = 0;
SVideoInitialize *_pVideoInitialize = (SVideoInitialize*)init;
// Create a shortcut to _pVideoInitialize that can also update it
g_VideoInitialize = *(_pVideoInitialize);
InitXFBConvTables();
g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str());
g_Config.GameIniLoad(globals->game_ini);
g_Config.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
UpdateProjectionHack(g_Config.iPhackvalue, g_Config.sPhackvalue); // DX9 projection hack could be disabled by commenting out this line
UpdateActiveConfig();
g_VideoInitialize.pWindowHandle = (void*)EmuWindow::Create((HWND)g_VideoInitialize.pWindowHandle, g_hInstance, _T("Loading - Please wait."));
if (g_VideoInitialize.pWindowHandle == NULL)
VideoWindowHandle() = (void*)EmuWindow::Create((HWND)VideoWindowHandle(), GetModuleHandle(0), _T("Loading - Please wait."));
if (VideoWindowHandle() == NULL)
{
ERROR_LOG(VIDEO, "An error has occurred while trying to create the window.");
return;
@ -247,20 +173,11 @@ void Initialize(void *init)
return;
}
g_VideoInitialize.pPeekMessages = &Callback_PeekMessages;
g_VideoInitialize.pUpdateFPSDisplay = &UpdateFPSDisplay;
_pVideoInitialize->pPeekMessages = g_VideoInitialize.pPeekMessages;
_pVideoInitialize->pUpdateFPSDisplay = g_VideoInitialize.pUpdateFPSDisplay;
// Now the window handle is written
_pVideoInitialize->pWindowHandle = g_VideoInitialize.pWindowHandle;
OSD::AddMessage("Dolphin Direct3D9 Video Plugin.", 5000);
s_PluginInitialized = true;
}
void Video_Prepare()
void VideoBackend::Video_Prepare()
{
// Better be safe...
s_efbAccessRequested = FALSE;
@ -268,9 +185,9 @@ void Video_Prepare()
s_swapRequested = FALSE;
// internal interfaces
g_renderer = new DX9::Renderer;
g_texture_cache = new DX9::TextureCache;
g_vertex_manager = new DX9::VertexManager;
g_renderer = new Renderer;
g_texture_cache = new TextureCache;
g_vertex_manager = new VertexManager;
// VideoCommon
BPInit();
Fifo_Init();
@ -283,10 +200,10 @@ void Video_Prepare()
DLCache::Init();
// Notify the core that the video plugin is ready
g_VideoInitialize.pCoreMessage(WM_USER_CREATE);
Core::Callback_CoreMessage(WM_USER_CREATE);
}
void Shutdown()
void VideoBackend::Shutdown()
{
s_PluginInitialized = false;
@ -304,11 +221,13 @@ void Shutdown()
VertexLoaderManager::Shutdown();
// internal interfaces
DX9::PixelShaderCache::Shutdown();
DX9::VertexShaderCache::Shutdown();
PixelShaderCache::Shutdown();
VertexShaderCache::Shutdown();
delete g_vertex_manager;
delete g_texture_cache;
delete g_renderer;
DX9::D3D::Shutdown();
D3D::Shutdown();
EmuWindow::Close();
}
}

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