mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
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:
@ -15,7 +15,6 @@
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "pluginspecs_video.h"
|
||||
#include "../../../Core/VideoCommon/Src/VideoCommon.h"
|
||||
#include "main.h"
|
||||
|
||||
@ -25,9 +24,10 @@
|
||||
#include "PixelEngine.h"
|
||||
#include "Tev.h"
|
||||
#include "../../../Core/VideoCommon/Src/TextureDecoder.h"
|
||||
#include "HW/Memmap.h"
|
||||
#include "Core.h"
|
||||
|
||||
|
||||
BPMemory bpmem;
|
||||
extern BPMemory bpmem;
|
||||
|
||||
void InitBPMemory()
|
||||
{
|
||||
@ -104,10 +104,10 @@ void BPWritten(int address, int newvalue)
|
||||
u8 *ptr = 0;
|
||||
|
||||
// TODO - figure out a cleaner way.
|
||||
if (g_VideoInitialize.bWii)
|
||||
ptr = g_VideoInitialize.pGetMemoryPointer(bpmem.tlutXferSrc << 5);
|
||||
if (Core::g_CoreStartupParameter.bWii)
|
||||
ptr = Memory::GetPointer(bpmem.tlutXferSrc << 5);
|
||||
else
|
||||
ptr = g_VideoInitialize.pGetMemoryPointer((bpmem.tlutXferSrc & 0xFFFFF) << 5);
|
||||
ptr = Memory::GetPointer((bpmem.tlutXferSrc & 0xFFFFF) << 5);
|
||||
|
||||
if (ptr)
|
||||
memcpy_gc(texMem + tlutTMemAddr, ptr, tlutXferCount);
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "VideoCommon.h"
|
||||
|
||||
#include "CPMemLoader.h"
|
||||
|
||||
#include "HW/Memmap.h"
|
||||
|
||||
// CP state
|
||||
u8 *cached_arraybases[16];
|
||||
@ -71,7 +71,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:
|
||||
|
@ -16,9 +16,13 @@
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "Common.h"
|
||||
#include "pluginspecs_video.h"
|
||||
#include "Thread.h"
|
||||
#include "Atomic.h"
|
||||
#include "ConfigManager.h"
|
||||
#include "Core.h"
|
||||
#include "CoreTiming.h"
|
||||
#include "HW/Memmap.h"
|
||||
#include "HW/ProcessorInterface.h"
|
||||
|
||||
#include "CommandProcessor.h"
|
||||
#include "ChunkFile.h"
|
||||
@ -109,7 +113,7 @@ void Init()
|
||||
|
||||
cpreg.token = 0;
|
||||
|
||||
et_UpdateInterrupts = g_VideoInitialize.pRegisterEvent("UpdateInterrupts", UpdateInterrupts_Wrapper);
|
||||
et_UpdateInterrupts = CoreTiming::RegisterEvent("UpdateInterrupts", UpdateInterrupts_Wrapper);
|
||||
|
||||
// internal buffer position
|
||||
readPos = 0;
|
||||
@ -128,7 +132,7 @@ void Shutdown()
|
||||
|
||||
void RunGpu()
|
||||
{
|
||||
if (!g_VideoInitialize.bOnThread)
|
||||
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread)
|
||||
{
|
||||
// We are going to do FP math on the main thread so have to save the current state
|
||||
SaveSSEState();
|
||||
@ -309,20 +313,20 @@ void UpdateInterrupts(u64 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 ReadFifo()
|
||||
@ -333,7 +337,7 @@ void ReadFifo()
|
||||
if (canRead && !atBreakpoint)
|
||||
{
|
||||
// read from fifo
|
||||
u8 *ptr = g_VideoInitialize.pGetMemoryPointer(cpreg.readptr);
|
||||
u8 *ptr = Memory::GetPointer(cpreg.readptr);
|
||||
int bytesRead = 0;
|
||||
|
||||
do
|
||||
@ -346,7 +350,7 @@ void ReadFifo()
|
||||
if (cpreg.readptr == cpreg.fifoend)
|
||||
{
|
||||
cpreg.readptr = cpreg.fifobase;
|
||||
ptr = g_VideoInitialize.pGetMemoryPointer(cpreg.readptr);
|
||||
ptr = Memory::GetPointer(cpreg.readptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -400,7 +404,7 @@ void SetStatus()
|
||||
if (interrupt != interruptSet && !interruptWaiting)
|
||||
{
|
||||
u64 userdata = interrupt?1:0;
|
||||
if (g_VideoInitialize.bOnThread)
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread)
|
||||
{
|
||||
interruptWaiting = true;
|
||||
CommandProcessor::UpdateInterruptsFromVideoPlugin(userdata);
|
||||
@ -470,13 +474,13 @@ bool RunBuffer()
|
||||
// fifo functions
|
||||
#if (SW_PLUGIN)
|
||||
|
||||
void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
|
||||
void Fifo_EnterLoop()
|
||||
{
|
||||
fifoStateRun = true;
|
||||
|
||||
while (fifoStateRun)
|
||||
{
|
||||
g_VideoInitialize.pPeekMessages();
|
||||
g_video_backend->PeekMessages();
|
||||
if (!CommandProcessor::RunBuffer()) {
|
||||
Common::YieldCPU();
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
#define _COMMANDPROCESSOR_H_
|
||||
|
||||
#include "Common.h"
|
||||
#include "pluginspecs_video.h"
|
||||
|
||||
class PointerWrap;
|
||||
|
||||
extern volatile bool g_bSkipCurrentFrame;
|
||||
@ -29,7 +29,7 @@ void Fifo_Init();
|
||||
void Fifo_Shutdown();
|
||||
void Fifo_DoState(PointerWrap &p);
|
||||
|
||||
void Fifo_EnterLoop(const SVideoInitialize &video_initialize);
|
||||
void Fifo_EnterLoop();
|
||||
void Fifo_ExitLoop();
|
||||
void Fifo_SetRendering(bool bEnabled);
|
||||
|
||||
|
@ -27,7 +27,8 @@
|
||||
#include "HwRasterizer.h"
|
||||
#include "CommandProcessor.h"
|
||||
#include "GLUtil.h"
|
||||
|
||||
#include "HW/Memmap.h"
|
||||
#include "Core.h"
|
||||
|
||||
namespace EfbCopy
|
||||
{
|
||||
@ -50,7 +51,7 @@ namespace EfbCopy
|
||||
{
|
||||
if (!g_SWVideoConfig.bHwRasterizer)
|
||||
{
|
||||
u8 *dest_ptr = g_VideoInitialize.pGetMemoryPointer(bpmem.copyTexDest << 5);
|
||||
u8 *dest_ptr = Memory::GetPointer(bpmem.copyTexDest << 5);
|
||||
|
||||
TextureEncoder::Encode(dest_ptr);
|
||||
}
|
||||
@ -85,7 +86,7 @@ namespace EfbCopy
|
||||
if (bpmem.triggerEFBCopy.copy_to_xfb)
|
||||
{
|
||||
CopyToXfb();
|
||||
g_VideoInitialize.pCopiedToXFB(false);
|
||||
Core::Callback_VideoCopiedToXFB(false);
|
||||
|
||||
stats.frameCount++;
|
||||
}
|
||||
@ -107,7 +108,7 @@ namespace EfbCopy
|
||||
if (bpmem.triggerEFBCopy.copy_to_xfb)
|
||||
{
|
||||
// no frame rendered but tell that a frame has finished for frame skip counter
|
||||
g_VideoInitialize.pCopiedToXFB(false);
|
||||
Core::Callback_VideoCopiedToXFB(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,9 @@
|
||||
#include "SWVideoConfig.h"
|
||||
#include "IniFile.h"
|
||||
#include "Setup.h"
|
||||
#include "ConfigManager.h"
|
||||
#include "Core.h"
|
||||
#include "Host.h"
|
||||
|
||||
#include "GLUtil.h"
|
||||
|
||||
@ -37,6 +40,11 @@ GLWindow GLWin;
|
||||
static int s_backbuffer_width;
|
||||
static int s_backbuffer_height;
|
||||
|
||||
static void*& VideoWindowHandle()
|
||||
{
|
||||
return SConfig::GetInstance().m_LocalCoreStartupParameter.hMainWindow;
|
||||
}
|
||||
|
||||
void OpenGL_SwapBuffers()
|
||||
{
|
||||
#if defined(USE_WX) && USE_WX
|
||||
@ -101,10 +109,10 @@ void UpdateFPSDisplay(const char *text)
|
||||
|
||||
// Create rendering window.
|
||||
// Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize()
|
||||
bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _twidth, int _theight)
|
||||
bool OpenGL_Create(int _twidth, int _theight)
|
||||
{
|
||||
int xPos, yPos;
|
||||
g_VideoInitialize.pGetWindowSize(xPos, yPos, _twidth, _theight);
|
||||
Core::Callback_VideoGetWindowSize(xPos, yPos, _twidth, _theight);
|
||||
|
||||
#if defined(_WIN32)
|
||||
EmuWindow::SetSize(_twidth, _theight);
|
||||
@ -114,11 +122,8 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _twidth, int _theight
|
||||
s_backbuffer_width = _twidth;
|
||||
s_backbuffer_height = _theight;
|
||||
|
||||
g_VideoInitialize.pPeekMessages = &Callback_PeekMessages;
|
||||
g_VideoInitialize.pUpdateFPSDisplay = &UpdateFPSDisplay;
|
||||
|
||||
#if defined(USE_WX) && USE_WX
|
||||
GLWin.panel = (wxPanel *)g_VideoInitialize.pWindowHandle;
|
||||
GLWin.panel = (wxPanel*)VideoWindowHandle();
|
||||
GLWin.glCanvas = new wxGLCanvas(GLWin.panel, wxID_ANY, NULL,
|
||||
wxPoint(0, 0), wxSize(_twidth, _theight));
|
||||
GLWin.glCanvas->Show(true);
|
||||
@ -127,14 +132,14 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _twidth, int _theight
|
||||
|
||||
#elif defined(_WIN32)
|
||||
// Create rendering window in Windows
|
||||
g_VideoInitialize.pWindowHandle = (void*)EmuWindow::Create((HWND)g_VideoInitialize.pWindowHandle, g_hInstance, _T("Please wait..."));
|
||||
VideoWindowHandle() = (void*)EmuWindow::Create((HWND)VideoWindowHandle(), g_hInstance, _T("Please wait..."));
|
||||
|
||||
// Show the window
|
||||
EmuWindow::Show();
|
||||
|
||||
if (g_VideoInitialize.pWindowHandle == NULL)
|
||||
if (VideoWindowHandle() == NULL)
|
||||
{
|
||||
g_VideoInitialize.pSysMessage("failed to create window");
|
||||
Host_SysMessage("failed to create window");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -301,7 +306,7 @@ bool OpenGL_MakeCurrent()
|
||||
#elif defined(_WIN32)
|
||||
return wglMakeCurrent(hDC,hRC) ? true : false;
|
||||
#elif defined(HAVE_X11) && HAVE_X11
|
||||
g_VideoInitialize.pGetWindowSize(GLWin.x, GLWin.y, (int&)GLWin.width, (int&)GLWin.height);
|
||||
Core::Callback_VideoGetWindowSize(GLWin.x, GLWin.y, (int&)GLWin.width, (int&)GLWin.height);
|
||||
XMoveResizeWindow(GLWin.dpy, GLWin.win, GLWin.x, GLWin.y, GLWin.width, GLWin.height);
|
||||
return glXMakeCurrent(GLWin.dpy, GLWin.win, GLWin.ctx);
|
||||
#endif
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
#include <string>
|
||||
#include "SWVideoConfig.h"
|
||||
#include "pluginspecs_video.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define GLEW_STATIC
|
||||
@ -78,7 +77,7 @@ extern GLWindow GLWin;
|
||||
// Public OpenGL util
|
||||
|
||||
// Initialization / upkeep
|
||||
bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _width, int _height);
|
||||
bool OpenGL_Create(int _width, int _height);
|
||||
void OpenGL_Shutdown();
|
||||
void OpenGL_Update();
|
||||
bool OpenGL_MakeCurrent();
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "DebugUtil.h"
|
||||
#include "CommandProcessor.h"
|
||||
#include "SWVideoConfig.h"
|
||||
#include "HW/Memmap.h"
|
||||
|
||||
typedef void (*DecodingFunction)(u32);
|
||||
DecodingFunction currentFunction = NULL;
|
||||
@ -96,7 +97,7 @@ void ExecuteDisplayList(u32 addr, u32 count)
|
||||
{
|
||||
u8 *videoDataSave = g_pVideoData;
|
||||
|
||||
u8 *dlStart = g_VideoInitialize.pGetMemoryPointer(addr);
|
||||
u8 *dlStart = Memory::GetPointer(addr);
|
||||
|
||||
g_pVideoData = dlStart;
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
#ifndef _OPCODEDECODER_H_
|
||||
#define _OPCODEDECODER_H_
|
||||
|
||||
#include "pluginspecs_video.h"
|
||||
#include "CommonTypes.h"
|
||||
|
||||
namespace OpcodeDecoder
|
||||
{
|
||||
|
@ -22,6 +22,9 @@
|
||||
|
||||
#include "Common.h"
|
||||
#include "ChunkFile.h"
|
||||
#include "CoreTiming.h"
|
||||
#include "ConfigManager.h"
|
||||
#include "HW/ProcessorInterface.h"
|
||||
|
||||
#include "PixelEngine.h"
|
||||
#include "CommandProcessor.h"
|
||||
@ -64,8 +67,8 @@ void Init()
|
||||
et_SetTokenOnMainThread = false;
|
||||
g_bSignalFinishInterrupt = false;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
void Read16(u16& _uReturnValue, const u32 _iAddress)
|
||||
@ -114,22 +117,22 @@ void Write16(const u16 _iValue, const u32 _iAddress)
|
||||
|
||||
bool AllowIdleSkipping()
|
||||
{
|
||||
return !g_VideoInitialize.bOnThread || (!pereg.ctrl.PETokenEnable && !pereg.ctrl.PEFinishEnable);
|
||||
return !SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread || (!pereg.ctrl.PETokenEnable && !pereg.ctrl.PEFinishEnable);
|
||||
}
|
||||
|
||||
void UpdateInterrupts()
|
||||
{
|
||||
// check if there is a token-interrupt
|
||||
if (g_bSignalTokenInterrupt & pereg.ctrl.PETokenEnable)
|
||||
g_VideoInitialize.pSetInterrupt(INT_CAUSE_PE_TOKEN, true);
|
||||
ProcessorInterface::SetInterrupt(INT_CAUSE_PE_TOKEN, true);
|
||||
else
|
||||
g_VideoInitialize.pSetInterrupt(INT_CAUSE_PE_TOKEN, false);
|
||||
ProcessorInterface::SetInterrupt(INT_CAUSE_PE_TOKEN, false);
|
||||
|
||||
// check if there is a finish-interrupt
|
||||
if (g_bSignalFinishInterrupt & pereg.ctrl.PEFinishEnable)
|
||||
g_VideoInitialize.pSetInterrupt(INT_CAUSE_PE_FINISH, true);
|
||||
ProcessorInterface::SetInterrupt(INT_CAUSE_PE_FINISH, true);
|
||||
else
|
||||
g_VideoInitialize.pSetInterrupt(INT_CAUSE_PE_FINISH, false);
|
||||
ProcessorInterface::SetInterrupt(INT_CAUSE_PE_FINISH, false);
|
||||
}
|
||||
|
||||
|
||||
@ -154,8 +157,8 @@ void SetToken(const u16 _token, const int _bSetTokenAcknowledge)
|
||||
pereg.token = _token;
|
||||
if (_bSetTokenAcknowledge) // set token INT
|
||||
{
|
||||
g_VideoInitialize.pScheduleEvent_Threadsafe(
|
||||
0, et_SetTokenOnMainThread, _token | (_bSetTokenAcknowledge << 16));
|
||||
CoreTiming::ScheduleEvent_Threadsafe(0, et_SetTokenOnMainThread,
|
||||
_token | (_bSetTokenAcknowledge << 16));
|
||||
}
|
||||
}
|
||||
|
||||
@ -163,8 +166,7 @@ void SetToken(const u16 _token, const int _bSetTokenAcknowledge)
|
||||
// THIS IS EXECUTED FROM VIDEO THREAD
|
||||
void SetFinish()
|
||||
{
|
||||
g_VideoInitialize.pScheduleEvent_Threadsafe(
|
||||
0, et_SetFinishOnMainThread, 0);
|
||||
CoreTiming::ScheduleEvent_Threadsafe(0, et_SetFinishOnMainThread, 0);
|
||||
INFO_LOG(PIXELENGINE, "VIDEO Set Finish");
|
||||
}
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
#define _PIXELENGINE_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "pluginspecs_video.h"
|
||||
#include "VideoCommon.h"
|
||||
|
||||
class PointerWrap;
|
||||
|
||||
namespace PixelEngine
|
||||
|
@ -16,6 +16,7 @@
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "Common.h"
|
||||
#include "Core.h"
|
||||
|
||||
#include "GLUtil.h"
|
||||
#include "Renderer.h"
|
||||
@ -29,17 +30,13 @@ static GLuint s_RenderTarget = 0;
|
||||
|
||||
RasterFont* s_pfont = NULL;
|
||||
|
||||
void Renderer::Init(SVideoInitialize *_pVideoInitialize)
|
||||
void Renderer::Init()
|
||||
{
|
||||
if (!OpenGL_Create(g_VideoInitialize, 640, 480)) // 640x480 will be the default if all else fails
|
||||
if (!OpenGL_Create(640, 480)) // 640x480 will be the default if all else fails
|
||||
{
|
||||
g_VideoInitialize.pLog("Renderer::Create failed\n", TRUE);
|
||||
Core::Callback_VideoLog("Renderer::Create failed\n", TRUE);
|
||||
return;
|
||||
}
|
||||
|
||||
_pVideoInitialize->pPeekMessages = g_VideoInitialize.pPeekMessages;
|
||||
_pVideoInitialize->pUpdateFPSDisplay = g_VideoInitialize.pUpdateFPSDisplay;
|
||||
_pVideoInitialize->pWindowHandle = g_VideoInitialize.pWindowHandle;
|
||||
}
|
||||
|
||||
void Renderer::Shutdown()
|
||||
|
@ -18,11 +18,11 @@
|
||||
#ifndef _RENDERER_H_
|
||||
#define _RENDERER_H_
|
||||
|
||||
#include "pluginspecs_video.h"
|
||||
#include "CommonTypes.h"
|
||||
|
||||
namespace Renderer
|
||||
{
|
||||
void Init(SVideoInitialize *_pVideoInitialize);
|
||||
void Init();
|
||||
void Prepare();
|
||||
void Shutdown();
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "BPMemLoader.h"
|
||||
#include "../../../Core/VideoCommon/Src/TextureDecoder.h"
|
||||
#include "HW/Memmap.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
@ -121,7 +122,7 @@ void SampleMip(s32 s, s32 t, s32 mip, bool linear, u8 texmap, u8 *sample)
|
||||
TexTLUT& texTlut = texUnit.texTlut[subTexmap];
|
||||
|
||||
u32 imageBase = texUnit.texImage3[subTexmap].image_base << 5;
|
||||
u8 *imageSrc = g_VideoInitialize.pGetMemoryPointer(imageBase);
|
||||
u8 *imageSrc = Memory::GetPointer(imageBase);
|
||||
|
||||
int imageWidth = ti0.width;
|
||||
int imageHeight = ti0.height;
|
||||
|
46
Source/Plugins/Plugin_VideoSoftware/Src/VideoBackend.h
Normal file
46
Source/Plugins/Plugin_VideoSoftware/Src/VideoBackend.h
Normal file
@ -0,0 +1,46 @@
|
||||
|
||||
#ifndef SW_VIDEO_BACKEND_H_
|
||||
#define SW_VIDEO_BACKEND_H_
|
||||
|
||||
#include "VideoBackendBase.h"
|
||||
|
||||
namespace SW
|
||||
{
|
||||
|
||||
class VideoBackend : public VideoBackendLLE
|
||||
{
|
||||
void Initialize();
|
||||
void Shutdown();
|
||||
|
||||
std::string GetName();
|
||||
|
||||
void EmuStateChange(PLUGIN_EMUSTATE newState);
|
||||
|
||||
void DoState(PointerWrap &p);
|
||||
|
||||
void ShowConfig(void* parent);
|
||||
|
||||
void Video_Prepare();
|
||||
|
||||
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();
|
||||
|
||||
void UpdateFPSDisplay(const char*);
|
||||
unsigned int PeekMessages();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -23,54 +23,13 @@
|
||||
#include <wx/dialog.h>
|
||||
#include <wx/aboutdlg.h>
|
||||
|
||||
#include "ConfigManager.h"
|
||||
#include "SWVideoConfig.h"
|
||||
#include "main.h"
|
||||
#include "Win32.h"
|
||||
|
||||
#include "StringUtil.h"
|
||||
|
||||
|
||||
HINSTANCE g_hInstance;
|
||||
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
class wxDLLApp : public wxApp
|
||||
{
|
||||
bool OnInit()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
IMPLEMENT_APP_NO_MAIN(wxDLLApp)
|
||||
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
|
||||
#endif
|
||||
// ------------------
|
||||
|
||||
BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle
|
||||
DWORD dwReason, // reason called
|
||||
LPVOID lpvReserved) // reserved
|
||||
{
|
||||
switch (dwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
{
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
wxSetInstance((HINSTANCE)hinstDLL);
|
||||
wxInitialize();
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
wxUninitialize();
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
g_hInstance = hinstDLL;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// ----------------------
|
||||
// The rendering window
|
||||
// ----------------------
|
||||
@ -80,11 +39,15 @@ namespace EmuWindow
|
||||
HWND m_hWnd = NULL; // The new window that is created here
|
||||
HWND m_hParent = NULL;
|
||||
|
||||
HINSTANCE m_hInstance = NULL;
|
||||
WNDCLASSEX wndClass;
|
||||
const TCHAR m_szClassName[] = _T("DolphinEmuWnd");
|
||||
int g_winstyle;
|
||||
|
||||
static void*& VideoWindowHandle()
|
||||
{
|
||||
return SConfig::GetInstance().m_LocalCoreStartupParameter.hMainWindow;
|
||||
}
|
||||
|
||||
// ------------------------------------------
|
||||
/* Invisible cursor option. In the lack of a predefined IDC_BLANK we make
|
||||
an empty transparent cursor */
|
||||
@ -202,7 +165,7 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
Shutdown();
|
||||
g_video_backend->Shutdown();
|
||||
break;
|
||||
|
||||
// Called when a screensaver wants to show up while this window is active
|
||||
@ -241,10 +204,10 @@ HWND OpenWindow(HWND parent, HINSTANCE hInstance, int width, int height, const T
|
||||
wndClass.lpszClassName = m_szClassName;
|
||||
wndClass.hIconSm = LoadIcon( NULL, IDI_APPLICATION );
|
||||
|
||||
m_hInstance = hInstance;
|
||||
//m_hInstance = hInstance;
|
||||
RegisterClassEx( &wndClass );
|
||||
|
||||
CreateCursors(m_hInstance);
|
||||
CreateCursors(/*m_hInstance*/GetModuleHandle(0));
|
||||
|
||||
// Create child window
|
||||
if (parent)
|
||||
@ -275,7 +238,7 @@ HWND OpenWindow(HWND parent, HINSTANCE hInstance, int width, int height, const T
|
||||
rc.top = (1024 - h)/2;
|
||||
rc.bottom = rc.top + h;
|
||||
|
||||
m_hParent = (HWND)g_VideoInitialize.pWindowHandle;
|
||||
m_hParent = (HWND)VideoWindowHandle();
|
||||
|
||||
m_hWnd = CreateWindow(m_szClassName, title,
|
||||
style,
|
||||
@ -364,7 +327,7 @@ void Close()
|
||||
{
|
||||
if (!m_hParent)
|
||||
DestroyWindow(m_hWnd);
|
||||
UnregisterClass(m_szClassName, m_hInstance);
|
||||
UnregisterClass(m_szClassName, /*m_hInstance*/GetModuleHandle(0));
|
||||
}
|
||||
|
||||
// ------------------------------------------
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "XFMemLoader.h"
|
||||
#include "CPMemLoader.h"
|
||||
#include "Clipper.h"
|
||||
|
||||
#include "HW/Memmap.h"
|
||||
|
||||
XFRegisters xfregs;
|
||||
|
||||
@ -90,7 +90,7 @@ void LoadIndexedXF(u32 val, int array)
|
||||
int size = ((val >> 12) & 0xF) + 1;
|
||||
//load stuff from array to address in xf mem
|
||||
|
||||
u32 *pData = (u32*)g_VideoInitialize.pGetMemoryPointer(arraybases[array] + arraystrides[array]*index);
|
||||
u32 *pData = (u32*)Memory::GetPointer(arraybases[array] + arraystrides[array]*index);
|
||||
|
||||
// byteswap data
|
||||
u32 buffer[16];
|
||||
|
@ -17,7 +17,6 @@
|
||||
|
||||
|
||||
#include "Common.h"
|
||||
#include "pluginspecs_video.h"
|
||||
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
#include "VideoConfigDialog.h"
|
||||
@ -39,31 +38,14 @@
|
||||
#include "EfbInterface.h"
|
||||
#include "DebugUtil.h"
|
||||
#include "FileUtil.h"
|
||||
#include "VideoBackend.h"
|
||||
|
||||
|
||||
PLUGIN_GLOBALS* globals = NULL;
|
||||
SVideoInitialize g_VideoInitialize;
|
||||
|
||||
|
||||
void GetDllInfo (PLUGIN_INFO* _PluginInfo)
|
||||
namespace SW
|
||||
{
|
||||
_PluginInfo->Version = 0x0100;
|
||||
_PluginInfo->Type = PLUGIN_TYPE_VIDEO;
|
||||
#ifdef DEBUGFAST
|
||||
sprintf(_PluginInfo->Name, "Dolphin Software Renderer (DebugFast)");
|
||||
#else
|
||||
#ifndef _DEBUG
|
||||
sprintf(_PluginInfo->Name, "Dolphin Software Renderer");
|
||||
#else
|
||||
sprintf(_PluginInfo->Name, "Dolphin Software Renderer (Debug)");
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
|
||||
std::string VideoBackend::GetName()
|
||||
{
|
||||
globals = _pPluginGlobals;
|
||||
LogManager::SetInstance((LogManager *)globals->logManager);
|
||||
return "Software Renderer";
|
||||
}
|
||||
|
||||
void *DllDebugger(void *_hParent, bool Show)
|
||||
@ -71,7 +53,7 @@ void *DllDebugger(void *_hParent, bool Show)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void DllConfig(void *_hParent)
|
||||
void VideoBackend::ShowConfig(void *_hParent)
|
||||
{
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
VideoConfigDialog* const diag = new VideoConfigDialog((wxWindow*)_hParent, "Software", "gfx_software");
|
||||
@ -80,11 +62,8 @@ void DllConfig(void *_hParent)
|
||||
#endif
|
||||
}
|
||||
|
||||
void Initialize(void *init)
|
||||
void VideoBackend::Initialize()
|
||||
{
|
||||
SVideoInitialize *_pVideoInitialize = (SVideoInitialize*)init;
|
||||
g_VideoInitialize = *_pVideoInitialize;
|
||||
|
||||
g_SWVideoConfig.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_software.ini").c_str());
|
||||
|
||||
InitBPMemory();
|
||||
@ -95,31 +74,33 @@ void Initialize(void *init)
|
||||
Clipper::Init();
|
||||
Rasterizer::Init();
|
||||
HwRasterizer::Init();
|
||||
Renderer::Init(_pVideoInitialize);
|
||||
Renderer::Init();
|
||||
DebugUtil::Init();
|
||||
}
|
||||
|
||||
void DoState(unsigned char **ptr, int mode)
|
||||
void VideoBackend::DoState(PointerWrap&)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void EmuStateChange(PLUGIN_EMUSTATE newState)
|
||||
void VideoBackend::EmuStateChange(PLUGIN_EMUSTATE newState)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool IsD3D()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//bool IsD3D()
|
||||
//{
|
||||
// return false;
|
||||
//}
|
||||
|
||||
void Shutdown(void)
|
||||
void VideoBackend::Shutdown()
|
||||
{
|
||||
Renderer::Shutdown();
|
||||
OpenGL_Shutdown();
|
||||
}
|
||||
|
||||
// This is called after Video_Initialize() from the Core
|
||||
void Video_Prepare(void)
|
||||
void VideoBackend::Video_Prepare()
|
||||
{
|
||||
Renderer::Prepare();
|
||||
|
||||
@ -127,16 +108,16 @@ void Video_Prepare(void)
|
||||
}
|
||||
|
||||
// Run from the CPU thread (from VideoInterface.cpp)
|
||||
void Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
|
||||
void VideoBackend::Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
|
||||
{
|
||||
}
|
||||
|
||||
// Run from the CPU thread (from VideoInterface.cpp)
|
||||
void Video_EndField()
|
||||
void VideoBackend::Video_EndField()
|
||||
{
|
||||
}
|
||||
|
||||
u32 Video_AccessEFB(EFBAccessType type, u32 x, u32 y, u32 InputData)
|
||||
u32 VideoBackend::Video_AccessEFB(EFBAccessType type, u32 x, u32 y, u32 InputData)
|
||||
{
|
||||
u32 value = 0;
|
||||
|
||||
@ -166,71 +147,46 @@ u32 Video_AccessEFB(EFBAccessType type, u32 x, u32 y, u32 InputData)
|
||||
return value;
|
||||
}
|
||||
|
||||
void Video_Screenshot(const char *_szFilename)
|
||||
bool VideoBackend::Video_Screenshot(const char *_szFilename)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// -------------------------------
|
||||
// Enter and exit the video loop
|
||||
// -------------------------------
|
||||
void Video_EnterLoop()
|
||||
void VideoBackend::Video_EnterLoop()
|
||||
{
|
||||
Fifo_EnterLoop(g_VideoInitialize);
|
||||
Fifo_EnterLoop();
|
||||
}
|
||||
|
||||
void Video_ExitLoop()
|
||||
void VideoBackend::Video_ExitLoop()
|
||||
{
|
||||
Fifo_ExitLoop();
|
||||
}
|
||||
|
||||
void Video_AddMessage(const char* pstr, u32 milliseconds)
|
||||
void VideoBackend::Video_AddMessage(const char* pstr, u32 milliseconds)
|
||||
{
|
||||
}
|
||||
|
||||
void Video_SetRendering(bool bEnabled)
|
||||
void VideoBackend::Video_SetRendering(bool bEnabled)
|
||||
{
|
||||
Fifo_SetRendering(bEnabled);
|
||||
}
|
||||
|
||||
void Video_CommandProcessorRead16(u16& _rReturnValue, const u32 _Address)
|
||||
void VideoBackend::Video_WaitForFrameFinish(void)
|
||||
{
|
||||
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)
|
||||
{
|
||||
CommandProcessor::GatherPipeBursted();
|
||||
}
|
||||
|
||||
void Video_WaitForFrameFinish(void)
|
||||
{
|
||||
}
|
||||
|
||||
bool Video_IsFifoBusy(void)
|
||||
bool VideoBackend::Video_IsFifoBusy(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void Video_AbortFrame(void)
|
||||
void VideoBackend::Video_AbortFrame(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -18,8 +18,6 @@
|
||||
#ifndef MAIN_H
|
||||
#define MAIN_H
|
||||
|
||||
#include "pluginspecs_video.h"
|
||||
|
||||
extern SVideoInitialize g_VideoInitialize;
|
||||
#include "VideoBackend.h"
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user