135 changes: 0 additions & 135 deletions Source/Core/Common/Src/Plugin.cpp

This file was deleted.

75 changes: 0 additions & 75 deletions Source/Core/Common/Src/Plugin.h

This file was deleted.

104 changes: 0 additions & 104 deletions Source/Core/Common/Src/PluginVideo.cpp

This file was deleted.

79 changes: 0 additions & 79 deletions Source/Core/Common/Src/PluginVideo.h

This file was deleted.

58 changes: 58 additions & 0 deletions Source/Core/Common/Src/VideoBackendBase.cpp
@@ -0,0 +1,58 @@
// Copyright (C) 2003 Dolphin Project.

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.

// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/

// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/

#include "VideoBackendBase.h"

// TODO: ugly
#ifdef _WIN32
#include "../Plugins/Plugin_VideoDX9/Src/VideoBackend.h"
#include "../Plugins/Plugin_VideoDX11/Src/VideoBackend.h"
#endif
#include "../Plugins/Plugin_VideoOGL/Src/VideoBackend.h"
//#include "../Plugins/Plugin_VideoSoftware/Src/VideoBackend.h"

std::vector<VideoBackend*> g_available_video_backends;
VideoBackend* g_video_backend = NULL;

void VideoBackend::PopulateList()
{
#ifdef _WIN32
g_available_video_backends.push_back(new DX9::VideoBackend);
// TODO: if (winver >= VISTA) :p
g_available_video_backends.push_back(new DX11::VideoBackend);
#endif
g_available_video_backends.push_back(new OGL::VideoBackend);
//g_available_video_backends.push_back(new SW::VideoBackend);

g_video_backend = g_available_video_backends.front();
}

void VideoBackend::ClearList()
{
while (!g_available_video_backends.empty())
{
delete g_available_video_backends.back();
g_available_video_backends.pop_back();
}
}

void VideoBackend::ActivateBackend(const std::string& name)
{
for (std::vector<VideoBackend*>::const_iterator it = g_available_video_backends.begin(); it != g_available_video_backends.end(); ++it)
if (name == (*it)->GetName())
g_video_backend = *it;
}
156 changes: 156 additions & 0 deletions Source/Core/Common/Src/VideoBackendBase.h
@@ -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
22 changes: 7 additions & 15 deletions Source/Core/Core/Core.vcproj
@@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
>
Expand Down
68 changes: 59 additions & 9 deletions Source/Core/Core/Core.vcxproj
Expand Up @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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" />
Expand Down Expand Up @@ -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" />
Expand Down Expand Up @@ -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" />
Expand Down Expand Up @@ -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" />
Expand Down Expand Up @@ -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>
3 changes: 2 additions & 1 deletion Source/Core/Core/Src/ConfigManager.cpp
Expand Up @@ -21,7 +21,6 @@
#include "CommonPaths.h"
#include "IniFile.h"
#include "ConfigManager.h"
#include "PluginManager.h"
#include "FileUtil.h"

SConfig* SConfig::m_Instance;
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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());
}

Expand Down
99 changes: 26 additions & 73 deletions Source/Core/Core/Src/Core.cpp
Expand Up @@ -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"
Expand All @@ -68,6 +68,9 @@
#include "State.h"
#include "OnFrame.h"

// TODO: ugly, remove
bool g_aspect_wide;

namespace Core
{

Expand All @@ -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();

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand All @@ -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 ----");

Expand All @@ -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();
Expand All @@ -246,7 +230,6 @@ void Stop() // - Hammertime!

void CpuThread()
{
CPluginManager &Plugins = CPluginManager::GetInstance();
const SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;

if (_CoreParameter.bCPUThread)
Expand All @@ -255,7 +238,7 @@ void CpuThread()
}
else
{
CPluginManager::GetInstance().GetVideo()->Video_Prepare();
g_video_backend->Video_Prepare();
Common::SetCurrentThreadName("CPU-GPU thread");
}

Expand All @@ -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();
Expand All @@ -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)
Expand All @@ -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);

Expand Down Expand Up @@ -395,15 +350,15 @@ 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");

// Update the window again because all stuff is initialized
Host_UpdateDisasmDialog();
Host_UpdateMainFrame();

Plugins.GetVideo()->Video_EnterLoop();
g_video_backend->Video_EnterLoop();
}
else // SingleCore mode
{
Expand All @@ -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);
}

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}
Expand Down
7 changes: 7 additions & 0 deletions Source/Core/Core/Src/Core.h
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/Src/CoreTiming.cpp
Expand Up @@ -22,7 +22,7 @@
#include "CoreTiming.h"
#include "Core.h"
#include "StringUtil.h"
#include "PluginManager.h"
#include "VideoBackendBase.h"

#define MAX_SLICE_LENGTH 20000

Expand Down Expand Up @@ -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();
Expand Down
11 changes: 4 additions & 7 deletions Source/Core/Core/Src/HW/CPU.cpp
Expand Up @@ -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
{
Expand Down Expand Up @@ -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);
}
}

Expand Down
1 change: 0 additions & 1 deletion Source/Core/Core/Src/HW/DSP.cpp
Expand Up @@ -45,7 +45,6 @@
#include "ProcessorInterface.h"
#include "AudioInterface.h"
#include "../PowerPC/PowerPC.h"
#include "../PluginManager.h"
#include "../ConfigManager.h"
#include "../PluginDSP.h"

Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/Src/HW/DSPLLE/DSPLLE.h
Expand Up @@ -29,6 +29,7 @@ class DSPLLE : public PluginDSP {

virtual void Initialize(void *hWnd, bool bWii, bool bDSPThread);
virtual void Shutdown();

virtual bool IsLLE() { return true; }

virtual void DoState(PointerWrap &p);
Expand Down
11 changes: 4 additions & 7 deletions Source/Core/Core/Src/HW/GPFifo.cpp
Expand Up @@ -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
Expand All @@ -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)
{
Expand All @@ -55,7 +54,6 @@ void DoState(PointerWrap &p)
void Init()
{
ResetGatherPipe();
m_GatherPipeBursted = CPluginManager::GetInstance().GetVideo()->Video_GatherPipeBursted;
}

bool IsEmpty()
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion Source/Core/Core/Src/HW/HW.cpp
Expand Up @@ -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"
Expand Down
24 changes: 12 additions & 12 deletions Source/Core/Core/Src/HW/Memmap.cpp
Expand Up @@ -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
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions Source/Core/Core/Src/HW/MemmapFunctions.cpp
Expand Up @@ -23,7 +23,7 @@
#include "WII_IOB.h"
#include "../Core.h"
#include "../PowerPC/PowerPC.h"
#include "../PluginManager.h"
#include "VideoBackendBase.h"

namespace Memory
{
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions Source/Core/Core/Src/HW/ProcessorInterface.cpp
Expand Up @@ -25,7 +25,8 @@
#include "../CoreTiming.h"
#include "ProcessorInterface.h"
#include "GPFifo.h"
#include "../PluginManager.h"
#include "VideoBackendBase.h"

namespace ProcessorInterface
{

Expand Down Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp
Expand Up @@ -23,8 +23,6 @@
#include "GCPadStatus.h"
#include "GCPad.h"

#include "../PluginManager.h" // for pad state

// where to put baseboard debug
#define AMBASEBOARDDEBUG OSREPORT

Expand Down
1 change: 0 additions & 1 deletion Source/Core/Core/Src/HW/SI_DeviceGCController.h
Expand Up @@ -18,7 +18,6 @@
#ifndef _SI_DEVICEGCCONTROLLER_H
#define _SI_DEVICEGCCONTROLLER_H

#include "../PluginManager.h"
#include "SI_Device.h"
#include "GCPadStatus.h"

Expand Down
5 changes: 2 additions & 3 deletions Source/Core/Core/Src/HW/SystemTimers.cpp
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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);
}

Expand Down
16 changes: 6 additions & 10 deletions Source/Core/Core/Src/HW/VideoInterface.cpp
Expand Up @@ -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
{

Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/Core/Src/LuaInterface.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions Source/Core/Core/Src/OnFrame.cpp
Expand Up @@ -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;

Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();
}
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/Src/PluginDSP.h
Expand Up @@ -19,6 +19,7 @@
#define _PLUGINDSP_H_


#include "PluginSpecs.h" // TODO: Only here for EmuStateChange
#include "ChunkFile.h"

class PluginDSP
Expand Down
295 changes: 0 additions & 295 deletions Source/Core/Core/Src/PluginManager.cpp

This file was deleted.

79 changes: 0 additions & 79 deletions Source/Core/Core/Src/PluginManager.h

This file was deleted.

5 changes: 2 additions & 3 deletions Source/Core/Core/Src/State.cpp
Expand Up @@ -30,7 +30,7 @@
#include "HW/CPU.h"
#include "PowerPC/JitCommon/JitBase.h"

#include "PluginManager.h"
#include "VideoBackendBase.h"

#include <string>

Expand Down Expand Up @@ -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());
Expand Down
1 change: 0 additions & 1 deletion Source/Core/DebuggerWX/Src/CodeWindow.cpp
Expand Up @@ -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
Expand Down
41 changes: 18 additions & 23 deletions Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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);

if (Win)
{
Win->Show();
Win->SetId(Id);
Parent->DoAddPage(Win,
iNbAffiliation[Id - IDM_LOGWINDOW],
Parent->bFloatWindow[Id - IDM_LOGWINDOW]);
}
//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]);
//}
}
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);
}
35 changes: 28 additions & 7 deletions Source/Core/DolphinWX/Dolphin.vcxproj
Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -424,14 +436,23 @@ 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" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
529 changes: 202 additions & 327 deletions Source/Core/DolphinWX/Src/ConfigMain.cpp

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions Source/Core/DolphinWX/Src/ConfigMain.h
Expand Up @@ -57,7 +57,6 @@ class CConfigMain : public wxDialog
ID_GAMECUBEPAGE,
ID_WIIPAGE,
ID_PATHSPAGE,
ID_PLUGINPAGE,
};

private:
Expand All @@ -75,7 +74,6 @@ class CConfigMain : public wxDialog
ID_LOCKTHREADS,
ID_DSPTHREAD,


ID_DISPLAY_FULLSCREENRES,
ID_DISPLAY_WINDOWWIDTH,
ID_DISPLAY_WINDOWHEIGHT,
Expand All @@ -102,7 +100,6 @@ class CConfigMain : public wxDialog
ID_INTERFACE_LANG,
ID_HOTKEY_CONFIG,


ID_GC_SRAM_LNG,

ID_GC_EXIDEVICE_SLOTA,
Expand Down Expand Up @@ -298,9 +295,6 @@ class CConfigMain : public wxDialog
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
6 changes: 2 additions & 4 deletions Source/Core/DolphinWX/Src/Frame.cpp
Expand Up @@ -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"
Expand All @@ -46,6 +45,8 @@
#include "State.h"
#include "VolumeHandler.h"

#include "VideoBackendBase.h"

#include <wx/datetime.h> // wxWidgets

// Resources
Expand Down Expand Up @@ -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)
{
Expand Down
1 change: 0 additions & 1 deletion Source/Core/DolphinWX/Src/FrameAui.cpp
Expand Up @@ -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"
Expand Down
18 changes: 4 additions & 14 deletions Source/Core/DolphinWX/Src/FrameTools.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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))
Expand Down
11 changes: 6 additions & 5 deletions Source/Core/DolphinWX/Src/Main.cpp
Expand Up @@ -31,7 +31,6 @@
#include "Setup.h"

#include "Host.h" // Core
#include "PluginManager.h"
#include "HW/Wiimote.h"

#include "Globals.h" // Local
Expand All @@ -43,6 +42,8 @@
#include "BootManager.h"
#include "Frame.h"

#include "VideoBackendBase.h"

#include <wx/intl.h>

// ------------
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -420,7 +423,7 @@ int DolphinApp::OnExit()
if (SConfig::GetInstance().m_WiiAutoUnpair)
WiimoteReal::UnPair();
#endif
CPluginManager::Shutdown();
VideoBackend::ClearList();
SConfig::Shutdown();
LogManager::Shutdown();

Expand All @@ -438,8 +441,6 @@ void DolphinApp::OnFatalException()
// ------------
// Talk to GUI


// g_VideoInitialize.pSysMessage() goes here
void Host_SysMessage(const char *fmt, ...)
{
va_list list;
Expand Down
6 changes: 4 additions & 2 deletions Source/Core/VideoCommon/Src/BPFunctions.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand Down
68 changes: 38 additions & 30 deletions Source/Core/VideoCommon/Src/CommandProcessor.cpp
Expand Up @@ -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;


Expand Down Expand Up @@ -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()
Expand All @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand All @@ -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)
Expand All @@ -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;
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();


Expand All @@ -667,7 +677,7 @@ void STACKALIGN GatherPipeBursted()



if (!g_VideoInitialize.bOnThread)
if (!IsOnThread())
{
CatchUpGPU();
if (!m_CPStatusReg.OverflowHiWatermark && fifo.CPReadWriteDistance >= fifo.CPHiWatermark)
Expand Down Expand Up @@ -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 ||
Expand Down Expand Up @@ -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()
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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())
Expand All @@ -901,7 +909,7 @@ void ProcessFifoToLoWatemark()

void ProcessFifoAllDistance()
{
if (g_VideoInitialize.bOnThread)
if (IsOnThread())
{
while (!CommandProcessor::interruptWaiting && fifo.bFF_GPReadEnable &&
fifo.CPReadWriteDistance && !AtBreakpoint())
Expand All @@ -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();
}


Expand Down
2 changes: 1 addition & 1 deletion Source/Core/VideoCommon/Src/CommandProcessor.h
Expand Up @@ -19,7 +19,7 @@
#define _COMMANDPROCESSOR_H

#include "Common.h"
#include "pluginspecs_video.h"
#include "VideoBackendBase.h"

class PointerWrap;

Expand Down
15 changes: 8 additions & 7 deletions Source/Core/VideoCommon/Src/DLCache.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/VideoCommon/Src/Debugger.cpp
Expand Up @@ -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()
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 4 additions & 3 deletions Source/Core/VideoCommon/Src/EmuWindow.cpp
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions Source/Core/VideoCommon/Src/Fifo.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand All @@ -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;

Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/VideoCommon/Src/Fifo.h
Expand Up @@ -18,8 +18,8 @@
#ifndef _FIFO_H
#define _FIFO_H

#include "pluginspecs_video.h"
#include "Common.h"
#include "VideoBackendBase.h"

class PointerWrap;

Expand All @@ -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);
Expand Down